Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,8 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Load your Hugging Face model
|
5 |
-
translator = pipeline("translation_en_to_fr", model="dreyyyy/EN-FR")
|
|
|
6 |
|
7 |
# Define the translation function
|
8 |
def translate_text(input_text):
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Load your Hugging Face model
|
5 |
+
translator = pipeline("translation_en_to_fr", model="dreyyyy/EN-FR", device=-1) # Use CPU explicitly
|
6 |
+
|
7 |
|
8 |
# Define the translation function
|
9 |
def translate_text(input_text):
|