Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
import time
|
5 |
|
@@ -68,7 +68,7 @@ def load_model():
|
|
68 |
# Using VietAI's Vietnamese GPT model
|
69 |
model_name = "google-t5/t5-base"
|
70 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
71 |
-
model =
|
72 |
return model, tokenizer
|
73 |
|
74 |
def generate_response(prompt, model, tokenizer, max_length=4169):
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
import torch
|
4 |
import time
|
5 |
|
|
|
68 |
# Using VietAI's Vietnamese GPT model
|
69 |
model_name = "google-t5/t5-base"
|
70 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
71 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
72 |
return model, tokenizer
|
73 |
|
74 |
def generate_response(prompt, model, tokenizer, max_length=4169):
|