Spaces:
Running
Running
acecalisto3
commited on
Commit
•
5436192
1
Parent(s):
30e98c1
Update app.py
Browse files
app.py
CHANGED
@@ -98,7 +98,7 @@ def chat_interface_with_agent(input_text, agent_name):
|
|
98 |
if agent_prompt is None:
|
99 |
return f"Agent {agent_name} not found."
|
100 |
|
101 |
-
model_name = "
|
102 |
try:
|
103 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
104 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
@@ -165,7 +165,7 @@ def sentiment_analysis(text):
|
|
165 |
# Text translation tool (code translation)
|
166 |
def translate_code(code, source_language, target_language):
|
167 |
# Use a Hugging Face translation model instead of OpenAI
|
168 |
-
translator = pipeline("translation", model="
|
169 |
translated_code = translator(code, target_lang=target_language)[0]['translation_text']
|
170 |
return translated_code
|
171 |
|
|
|
98 |
if agent_prompt is None:
|
99 |
return f"Agent {agent_name} not found."
|
100 |
|
101 |
+
model_name = "Codestral-22B-v0.1-GGUF"
|
102 |
try:
|
103 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
104 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
165 |
# Text translation tool (code translation)
|
166 |
def translate_code(code, source_language, target_language):
|
167 |
# Use a Hugging Face translation model instead of OpenAI
|
168 |
+
translator = pipeline("translation", model="bartowski/Codestral-22B-v0.1-GGUF") # Example: English to Spanish
|
169 |
translated_code = translator(code, target_lang=target_language)[0]['translation_text']
|
170 |
return translated_code
|
171 |
|