Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,7 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
provider="nebius",
|
| 6 |
-
api_key=os.environ["HF_API_TOKEN"],
|
| 7 |
-
)
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
messages=[
|
| 12 |
-
{
|
| 13 |
-
"role": "user",
|
| 14 |
-
"content": "What is the capital of France?"
|
| 15 |
-
}
|
| 16 |
-
],
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
-
print(completion.choices[0].message)
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
|
| 4 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
demo = gr.Interface.from_pipeline(pipe)
|
| 7 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|