Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,3 @@
|
|
1 |
-
import os
|
2 |
-
os.system("pip install transformers torch SentencePiece")
|
3 |
-
|
4 |
-
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
5 |
import gradio as gr
|
6 |
-
|
7 |
-
|
8 |
-
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-base")
|
9 |
-
|
10 |
-
print("Model loaded!")
|
11 |
-
# Generate a summary using the trained model
|
12 |
-
def generate_summary(input_text):
|
13 |
-
input_ids = tokenizer.encode(input_text, return_tensors='pt')
|
14 |
-
outputs = model.generate(input_ids)
|
15 |
-
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
16 |
-
return summary
|
17 |
-
|
18 |
-
ai = gr.Interface(fn=generate_summary, inputs="text", outputs="text")
|
19 |
-
|
20 |
-
ai.launch()
|
21 |
-
|
22 |
-
print("Interface Started!")
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
print("Starting!!1")
|
3 |
+
gr.Interface.load("models/lu2000luk/RuttoniAI").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|