Spaces:
Sleeping
Sleeping
RandomNameAnd6
commited on
Commit
•
92706a0
1
Parent(s):
8a50e1a
Update app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,10 @@ os.system('pip install --no-deps xformers "trl<0.9.0" peft accelerate bitsandbyt
|
|
5 |
import gradio as gr
|
6 |
import torch
|
7 |
import random
|
8 |
-
from transformers import
|
9 |
|
10 |
-
|
11 |
-
model =
|
12 |
|
13 |
def generate_text(prompt):
|
14 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
|
|
5 |
import gradio as gr
|
6 |
import torch
|
7 |
import random
|
8 |
+
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
9 |
|
10 |
+
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
|
11 |
+
model = GPT2LMHeadModel.from_pretrained('DharGPT-Small')
|
12 |
|
13 |
def generate_text(prompt):
|
14 |
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|