Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files
app.py
CHANGED
@@ -1,9 +1,22 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
|
|
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
@app.get("/")
|
9 |
def home():
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
3 |
+
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
|
4 |
+
import torch
|
5 |
|
6 |
app = FastAPI()
|
7 |
|
8 |
+
bnb_config = BitsAndBytesConfig(
|
9 |
+
load_in_4bit=True,
|
10 |
+
bnb_4bit_quant_type="nf4",
|
11 |
+
bnb_4bit_compute_dtype=torch.float16
|
12 |
+
)
|
13 |
+
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(
|
15 |
+
"VolkanSimsir/LLaMA-3-8B-GRPO-math-tr",
|
16 |
+
quantization_config=bnb_config,
|
17 |
+
torch_dtype=torch.float16,
|
18 |
+
device_map="auto"
|
19 |
+
)
|
20 |
|
21 |
@app.get("/")
|
22 |
def home():
|