Sreehitha-V commited on
Commit
92a701c
·
verified ·
1 Parent(s): 9d31e0d

Update model_api.py

Browse files
Files changed (1) hide show
  1. model_api.py +21 -0
model_api.py CHANGED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from huggingface_hub import InferenceClient
3
+
4
+ def query_model(prompt):
5
+ HF_TOKEN = os.getenv("HF_TOKEN")
6
+ client = InferenceClient(
7
+ model="Qwen/Qwen2.5-72B-Instruct",
8
+ token=HF_TOKEN
9
+ )
10
+ response = client.chat_completion(
11
+ messages=[
12
+ {
13
+ "role": "system",
14
+ "content": "You are a certified professional fitness trainer. Provide detailed, structured, day-by-day workout plans."
15
+ },
16
+ {"role": "user", "content": prompt}
17
+ ],
18
+ max_tokens=2500,
19
+ temperature=0.7
20
+ )
21
+ return response.choices[0].message.content