Spaces:
Runtime error
Runtime error
Commit
·
36e2d19
1
Parent(s):
4e5f040
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
import torch
|
2 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
3 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Load pretrained model and tokenizer
|
6 |
model_name = "zonghaoyang/DistilRoBERTa-base"
|
|
|
1 |
import torch
|
2 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
3 |
import gradio as gr
|
4 |
+
from transformers import RobertaConfig, RobertaModel
|
5 |
+
|
6 |
+
# Create a configuration object
|
7 |
+
config = RobertaConfig.from_pretrained('roberta-base')
|
8 |
+
|
9 |
+
# Create the Roberta model
|
10 |
+
model = RobertaModel.from_pretrained('roberta-base', config=config)
|
11 |
|
12 |
# Load pretrained model and tokenizer
|
13 |
model_name = "zonghaoyang/DistilRoBERTa-base"
|