Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,11 @@ HF_TOKEN = os.environ.get("HUGGINGFACE_API_TOKEN")
|
|
8 |
if not HF_TOKEN:
|
9 |
raise RuntimeError("Missing HUGGINGFACE_API_TOKEN secret")
|
10 |
|
11 |
-
# ساخت کلاینت
|
12 |
-
hf_client = InferenceClient(
|
|
|
|
|
|
|
13 |
|
14 |
def generate_topics(field, major, keywords, audience, level):
|
15 |
# اعتبارسنجی ورودیها
|
@@ -27,9 +30,8 @@ def generate_topics(field, major, keywords, audience, level):
|
|
27 |
)
|
28 |
|
29 |
try:
|
30 |
-
# فراخوانی
|
31 |
result = hf_client.text_generation(
|
32 |
-
"deepseek-ai/DeepSeek-Prover-V2-671B",
|
33 |
prompt,
|
34 |
max_new_tokens=512,
|
35 |
temperature=0.7
|
|
|
8 |
if not HF_TOKEN:
|
9 |
raise RuntimeError("Missing HUGGINGFACE_API_TOKEN secret")
|
10 |
|
11 |
+
# ساخت کلاینت با مدل پیشفرض
|
12 |
+
hf_client = InferenceClient(
|
13 |
+
model="deepseek-ai/DeepSeek-Prover-V2-671B",
|
14 |
+
token=HF_TOKEN
|
15 |
+
)
|
16 |
|
17 |
def generate_topics(field, major, keywords, audience, level):
|
18 |
# اعتبارسنجی ورودیها
|
|
|
30 |
)
|
31 |
|
32 |
try:
|
33 |
+
# فراخوانی مدل: فقط پرامپت بهصورت موقعیتی
|
34 |
result = hf_client.text_generation(
|
|
|
35 |
prompt,
|
36 |
max_new_tokens=512,
|
37 |
temperature=0.7
|