Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,8 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
# Import pandas datasets, transformers, torch
|
| 5 |
import pandas as pd
|
| 6 |
-
import torch
|
| 7 |
-
import tensorflow as tf
|
| 8 |
from datasets import load_dataset
|
| 9 |
|
| 10 |
from transformers import (
|
|
@@ -38,8 +38,8 @@ processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-larg
|
|
| 38 |
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large")
|
| 39 |
|
| 40 |
#Load transformer for translating captions from English to Spanish
|
| 41 |
-
trans_tokenizer = AutoTokenizer.from_pretrained("
|
| 42 |
-
trans_model = AutoModelForSeq2SeqLM.from_pretrained("
|
| 43 |
|
| 44 |
|
| 45 |
|
|
|
|
| 3 |
|
| 4 |
# Import pandas datasets, transformers, torch
|
| 5 |
import pandas as pd
|
| 6 |
+
#import torch
|
| 7 |
+
#import tensorflow as tf
|
| 8 |
from datasets import load_dataset
|
| 9 |
|
| 10 |
from transformers import (
|
|
|
|
| 38 |
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large")
|
| 39 |
|
| 40 |
#Load transformer for translating captions from English to Spanish
|
| 41 |
+
trans_tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-tc-big-en-es")
|
| 42 |
+
trans_model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-tc-big-en-es")
|
| 43 |
|
| 44 |
|
| 45 |
|