Spaces:
Sleeping
Sleeping
Commit ·
cc92ecb
1
Parent(s): 6b00fd0
feat: add unsloth
Browse files- requirements.txt +1 -0
- src/streamlit_app.py +3 -0
requirements.txt
CHANGED
|
@@ -8,3 +8,4 @@ torch==2.7.0
|
|
| 8 |
huggingface_hub>=0.33.1
|
| 9 |
bitsandbytes
|
| 10 |
accelerate>=0.26.0
|
|
|
|
|
|
| 8 |
huggingface_hub>=0.33.1
|
| 9 |
bitsandbytes
|
| 10 |
accelerate>=0.26.0
|
| 11 |
+
unsloth
|
src/streamlit_app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
| 3 |
|
| 4 |
# model_id = "sentence-transformers/all-MiniLM-L6-v2"
|
|
@@ -9,6 +10,8 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
|
| 9 |
model_id = "choco-conoz/TwinLlama-3.2-1B"
|
| 10 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 11 |
model = AutoModelForCausalLM.from_pretrained(model_id)
|
|
|
|
|
|
|
| 12 |
processor = pipeline(
|
| 13 |
"text-generation",
|
| 14 |
model=model,
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from unsloth import FastLanguageModel, is_bfloat16_supported
|
| 3 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
| 4 |
|
| 5 |
# model_id = "sentence-transformers/all-MiniLM-L6-v2"
|
|
|
|
| 10 |
model_id = "choco-conoz/TwinLlama-3.2-1B"
|
| 11 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 12 |
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 13 |
+
model = FastLanguageModel.for_inference(model)
|
| 14 |
+
|
| 15 |
processor = pipeline(
|
| 16 |
"text-generation",
|
| 17 |
model=model,
|