Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,16 +3,18 @@ import streamlit as st
|
|
3 |
|
4 |
import torch
|
5 |
from transformers import pipeline
|
6 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
7 |
|
|
|
8 |
|
9 |
-
|
|
|
10 |
|
11 |
|
12 |
model_name = "masakhane/zephyr-7b-gemma-sft-african-alpaca"
|
13 |
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
15 |
-
model = AutoModelForCausalLM.from_pretrained(model_name
|
16 |
|
17 |
|
18 |
pipe = pipeline("text-generation", model=model,tokenizer=tokenizer, torch_dtype=torch.bfloat16, device_map="auto")
|
|
|
3 |
|
4 |
import torch
|
5 |
from transformers import pipeline
|
6 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
7 |
|
8 |
+
# , BitsAndBytesConfig
|
9 |
|
10 |
+
|
11 |
+
# quantization_config = BitsAndBytesConfig(load_in_4bit=True)
|
12 |
|
13 |
|
14 |
model_name = "masakhane/zephyr-7b-gemma-sft-african-alpaca"
|
15 |
|
16 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
17 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
18 |
|
19 |
|
20 |
pipe = pipeline("text-generation", model=model,tokenizer=tokenizer, torch_dtype=torch.bfloat16, device_map="auto")
|