Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
from transformers import pipeline
|
|
|
4 |
#https://huggingface.co/facebook/opt-1.3b
|
5 |
generator = pipeline('text-generation', model="microsoft/DialoGPT-medium")
|
|
|
|
|
6 |
|
7 |
def create_audio(input_str):
|
8 |
output_raw= generator(input_str)
|
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
from transformers import pipeline
|
4 |
+
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
5 |
#https://huggingface.co/facebook/opt-1.3b
|
6 |
generator = pipeline('text-generation', model="microsoft/DialoGPT-medium")
|
7 |
+
tokenizer = GPT2Tokenizer.from_pretrained('microsoft/DialoGPT-medium')
|
8 |
+
model = GPT2LMHeadModel.from_pretrained('microsoft/DialoGPT-medium')
|
9 |
|
10 |
def create_audio(input_str):
|
11 |
output_raw= generator(input_str)
|