Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python3
- import sys
- # Example: reuse your existing OpenAI setup
- from openai import OpenAI
- prompt = sys.argv[1]
- prompt = prompt.strip().lower().replace(',', '')
- # Point to the local server
- client = OpenAI(base_url="http://localhost:9090/v1", api_key="lm-studio")
- completion = client.embeddings.create(
- model="nomic-embed-text-v1.5.q8_0",
- input=[
- prompt
- ],
- )
- print(f"\"{prompt}\",\"{completion.data[0].embedding}\"")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement