Isaac454 commited on
Commit
1b3edd6
·
verified ·
1 Parent(s): f273544

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -28,19 +28,22 @@ def translate_english_to_french(text: str) -> str:
28
  Returns:
29
  str: The translated French text.
30
  """
31
- model = HfApiModel(
32
  model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
33
- max_tokens=512,
34
  temperature=0.2,
35
  )
36
 
37
- prompt = f"Translate the following English text into French. Output only the translation:\n\n{text}"
 
 
 
38
 
39
- response = model(prompt)
40
  return response
41
 
42
 
43
 
 
44
  @tool
45
  def get_current_time_in_timezone(timezone: str) -> str:
46
  """
 
28
  Returns:
29
  str: The translated French text.
30
  """
31
+ local_model = HfApiModel(
32
  model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
33
+ max_tokens=256,
34
  temperature=0.2,
35
  )
36
 
37
+ response = local_model(
38
+ f"Translate the following English text into French. "
39
+ f"Output only the translation:\n{text}"
40
+ )
41
 
 
42
  return response
43
 
44
 
45
 
46
+
47
  @tool
48
  def get_current_time_in_timezone(timezone: str) -> str:
49
  """