Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,15 @@
|
|
1 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
model = pipeline("translation", model="BeebekBhz/Final-en-ne")
|
5 |
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
# Install transformers if missing
|
5 |
+
try:
|
6 |
+
import transformers
|
7 |
+
except ImportError:
|
8 |
+
subprocess.run(["pip", "install", "transformers"], check=True)
|
9 |
+
import transformers # Re-import after installation
|
10 |
+
|
11 |
from transformers import pipeline
|
12 |
+
import gradio as gr
|
13 |
|
14 |
model = pipeline("translation", model="BeebekBhz/Final-en-ne")
|
15 |
|