Update app.py
Browse files
app.py
CHANGED
|
@@ -24,6 +24,9 @@ summarization_models = {
|
|
| 24 |
# Initialize tokenizer
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained("t5-small") # Using t5-small tokenizer for all models
|
| 26 |
|
|
|
|
|
|
|
|
|
|
| 27 |
# Initialize translation pipeline
|
| 28 |
def get_translator(language):
|
| 29 |
model_name = translation_models.get(language)
|
|
@@ -123,3 +126,4 @@ iface.launch()
|
|
| 123 |
|
| 124 |
|
| 125 |
|
|
|
|
|
|
| 24 |
# Initialize tokenizer
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained("t5-small") # Using t5-small tokenizer for all models
|
| 26 |
|
| 27 |
+
# Initialize summarization pipelines
|
| 28 |
+
summarizers = {model: pipeline("summarization", model=model) for model in summarization_models.values()}
|
| 29 |
+
|
| 30 |
# Initialize translation pipeline
|
| 31 |
def get_translator(language):
|
| 32 |
model_name = translation_models.get(language)
|
|
|
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
+
|