Khoi1234210 commited on
Commit
13ad35d
·
verified ·
1 Parent(s): 24c8829

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -82,7 +82,24 @@ def create_math_system_message():
82
  5. **Alternative Methods** - Mention other possible approaches
83
 
84
  Always be precise, educational, and encourage mathematical thinking."""
85
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  def respond(
87
  message,
88
  history: list[dict[str, str]],
 
82
  5. **Alternative Methods** - Mention other possible approaches
83
 
84
  Always be precise, educational, and encourage mathematical thinking."""
85
+ def respond(
86
+ message,
87
+ history: list[dict[str, str]],
88
+ system_message,
89
+ max_tokens,
90
+ temperature,
91
+ top_p,
92
+ hf_token: gr.OAuthToken | None = None, # Make optional
93
+ ):
94
+ # Safe token handling
95
+ token = None
96
+ if hf_token and hasattr(hf_token, 'token'):
97
+ token = hf_token.token
98
+
99
+ client = InferenceClient(
100
+ token=token,
101
+ model="Qwen/Qwen2.5-Math-7B-Instruct"
102
+ )
103
  def respond(
104
  message,
105
  history: list[dict[str, str]],