Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,12 @@
|
|
1 |
import time
|
2 |
from transformers import pipeline, Conversation, GPT2LMHeadModel, AutoTokenizer
|
3 |
import gradio as gr
|
4 |
-
import torch
|
5 |
|
6 |
model_name = "ingen51/DialoGPT-medium-GPT4"
|
7 |
|
8 |
model = GPT2LMHeadModel.from_pretrained(model_name)
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side='left')
|
10 |
|
11 |
-
device = torch.device("cuda")
|
12 |
-
model.to(device)
|
13 |
-
|
14 |
chatbot = pipeline(task="conversational", model = model, tokenizer = tokenizer)
|
15 |
|
16 |
past_user_inputs = []
|
|
|
1 |
import time
|
2 |
from transformers import pipeline, Conversation, GPT2LMHeadModel, AutoTokenizer
|
3 |
import gradio as gr
|
|
|
4 |
|
5 |
model_name = "ingen51/DialoGPT-medium-GPT4"
|
6 |
|
7 |
model = GPT2LMHeadModel.from_pretrained(model_name)
|
8 |
tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side='left')
|
9 |
|
|
|
|
|
|
|
10 |
chatbot = pipeline(task="conversational", model = model, tokenizer = tokenizer)
|
11 |
|
12 |
past_user_inputs = []
|