Spaces:
Sleeping
Sleeping
Commit
·
1282945
1
Parent(s):
33e471c
kek
Browse files
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
4 |
translator = pipeline("translation_en_to_ru", model="Helsinki-NLP/opus-mt-en-ru")
|
5 |
image_classifier = pipeline("image-classification", model="microsoft/resnet-50")
|
6 |
|
7 |
-
# 3. Функция для перевода текста
|
8 |
def translate_to_russian(text):
|
9 |
try:
|
10 |
translation = translator(text)
|
@@ -21,7 +22,7 @@ def classify_image(image):
|
|
21 |
return output
|
22 |
|
23 |
with gr.Blocks() as demo:
|
24 |
-
gr.Markdown("
|
25 |
with gr.Tab("Классификация изображений"):
|
26 |
with gr.Row():
|
27 |
img_input = gr.Image(type="pil", label="Загрузите изображение")
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
#sentencepiece no installed??
|
5 |
+
|
6 |
translator = pipeline("translation_en_to_ru", model="Helsinki-NLP/opus-mt-en-ru")
|
7 |
image_classifier = pipeline("image-classification", model="microsoft/resnet-50")
|
8 |
|
|
|
9 |
def translate_to_russian(text):
|
10 |
try:
|
11 |
translation = translator(text)
|
|
|
22 |
return output
|
23 |
|
24 |
with gr.Blocks() as demo:
|
25 |
+
gr.Markdown("#Домашнее задание для курса ML2")
|
26 |
with gr.Tab("Классификация изображений"):
|
27 |
with gr.Row():
|
28 |
img_input = gr.Image(type="pil", label="Загрузите изображение")
|