Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,19 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
MODEL_ID,
|
| 9 |
-
dtype="auto",
|
| 10 |
-
device_map="auto"
|
| 11 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from openai import OpenAI
|
| 3 |
|
| 4 |
+
api_key = os.getenv("sk-869724fffbf74cc4a0225d0c90df4fd3")
|
| 5 |
|
| 6 |
+
client = OpenAI(
|
| 7 |
+
api_key=api_key,
|
| 8 |
+
base_url="https://api.deepseek.com",
|
|
|
|
|
|
|
|
|
|
| 9 |
)
|
| 10 |
+
|
| 11 |
+
response = client.chat.completions.create(
|
| 12 |
+
model="deepseek-chat", # أو deepseek-reasoner
|
| 13 |
+
messages=[
|
| 14 |
+
{"role": "user", "content": "مرحباً، كيف حالك؟"},
|
| 15 |
+
],
|
| 16 |
+
stream=False
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
print(response.choices[0].message.content)
|