Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
|
5 |
-
|
6 |
-
model_id = "HuggingFaceH4/zephyr-7b-alpha" # or openchat/openchat-3.5
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
8 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32)
|
9 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0 if torch.cuda.is_available() else -1)
|
|
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
|
5 |
+
model_id = "tiiuae/falcon-rw-1b"
|
|
|
6 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
7 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32)
|
8 |
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0 if torch.cuda.is_available() else -1)
|