Khoi1234210 commited on
Commit
2e74f3d
·
verified ·
1 Parent(s): b55ca90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -20
app.py CHANGED
@@ -62,32 +62,14 @@ def respond(
62
  max_tokens,
63
  temperature,
64
  top_p,
65
- # hf_token: gr.OAuthToken | None = None, # Make optional
66
- ):
67
- # Safe token handling
68
- token = None
69
- if hf_token and hasattr(hf_token, 'token'):
70
- token = hf_token.token
71
-
72
- client = InferenceClient(
73
- # token=token,
74
- model="Qwen/Qwen2.5-Math-7B-Instruct"
75
- )
76
- def respond(
77
- message,
78
- history: list[dict[str, str]],
79
- system_message,
80
- max_tokens,
81
- temperature,
82
- top_p,
83
- hf_token: gr.OAuthToken,
84
  ):
85
  """
86
  Enhanced response function for mathematical problem solving
87
  """
88
  # Use Qwen Math model for better mathematical reasoning
89
  client = InferenceClient(
90
- token=hf_token.token if hf_token else None,
91
  model="Qwen/Qwen2.5-Math-7B-Instruct" # Specialized math model
92
  )
93
 
 
62
  max_tokens,
63
  temperature,
64
  top_p,
65
+ # hf_token: gr.OAuthToken,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  ):
67
  """
68
  Enhanced response function for mathematical problem solving
69
  """
70
  # Use Qwen Math model for better mathematical reasoning
71
  client = InferenceClient(
72
+ # token=hf_token.token if hf_token else None,
73
  model="Qwen/Qwen2.5-Math-7B-Instruct" # Specialized math model
74
  )
75