kassemsabeh
commited on
Commit
•
76b1db8
1
Parent(s):
0997170
Update model
Browse files
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
|
|
3 |
from transformers import AutoTokenizer, T5ForConditionalGeneration
|
4 |
|
5 |
model_id = 'ksabeh/gavi'
|
6 |
max_input_length = 512
|
7 |
max_target_length = 10
|
|
|
8 |
|
9 |
-
model = T5ForConditionalGeneration.from_pretrained(model_id)
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
11 |
|
12 |
def predict(title, category):
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
import os
|
4 |
from transformers import AutoTokenizer, T5ForConditionalGeneration
|
5 |
|
6 |
model_id = 'ksabeh/gavi'
|
7 |
max_input_length = 512
|
8 |
max_target_length = 10
|
9 |
+
auth_token = os.environ.get('NAME')
|
10 |
|
11 |
+
model = T5ForConditionalGeneration.from_pretrained(model_id, use_auth_token=auth_token)
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
13 |
|
14 |
def predict(title, category):
|