Spaces:
Runtime error
Runtime error
File size: 639 Bytes
742b2a5 ab6d29f 742b2a5 ab6d29f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from openai import OpenAI
import os
client = OpenAI(
base_url="https://zxzbfrlg3ssrk7d9.us-east-1.aws.endpoints.huggingface.cloud/v1/",
api_key=os.getenv("HF_TOKEN")
)
def analyze_with_model(prompt):
try:
response = client.chat.completions.create(
model="DavidAU/OpenAi-GPT-oss-20b-abliterated-uncensored-NEO-Imatrix-gguf",
messages=[{"role": "user", "content": prompt}],
stream=False,
temperature=0.7,
max_tokens=1000
)
return response.choices[0].message.content
except Exception as e:
return f"Error during analysis: {str(e)}"
|