Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 32 |
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 33 |
-
max_tokens=
|
| 34 |
temperature=0.2,
|
| 35 |
)
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
"""
|