Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
import torch
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
|
6 |
-
|
7 |
-
|
8 |
|
9 |
|
10 |
-
# pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
11 |
|
12 |
def gentext(user_input="The world is"):
|
13 |
inputs = tokenizer(user_input, return_tensors="pt")
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import torch
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained("Salesforce/xgen-7b-8k-base", trust_remote_code=True)
|
6 |
+
model = AutoModelForCausalLM.from_pretrained("Salesforce/xgen-7b-8k-base", torch_dtype=torch.bfloat16)
|
7 |
|
8 |
|
|
|
9 |
|
10 |
def gentext(user_input="The world is"):
|
11 |
inputs = tokenizer(user_input, return_tensors="pt")
|