Spaces:
Runtime error
Runtime error
File size: 725 Bytes
ad21763 203866a e882144 ad21763 88570c9 ad21763 a54fee0 95d1712 a54fee0 95d1712 161b7ff ad21763 7772999 161b7ff 76b80a6 54795f5 76b80a6 6a071d8 76b80a6 3bca038 9532cb3 ad21763 161b7ff cf665c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import gradio as gr
import transformers
from transformers import AutoTokenizer
import torch
from diffusers.utils.torch_utils import randn_tensor
model = "Glasshes/debate_v3.1_model"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
def debate_response(text):
sequences = pipeline(
"hello \n",
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
max_length=100,
)
print(sequences)
return "testing"
intf = gr.Interface(fn=debate_response, inputs=gr.Textbox(), outputs="text")
intf.launch()
|