Spaces:
Runtime error
Runtime error
FlawedLLM
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
import re
|
2 |
import spaces
|
3 |
import gradio as gr
|
4 |
-
from transformers import AutoTokenizer,
|
5 |
import torch
|
6 |
-
from peft import PeftModel, PeftConfig
|
7 |
|
8 |
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/
|
10 |
-
quantization_config = BitsAndBytesConfig(
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
# model = AutoModelForCausalLM.from_pretrained("FlawedLLM/BhashiniLLM",
|
16 |
# device_map="auto",
|
17 |
# quantization_config=quantization_config,
|
@@ -34,9 +34,7 @@ quantization_config = BitsAndBytesConfig(
|
|
34 |
|
35 |
|
36 |
|
37 |
-
|
38 |
-
base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-bnb-4bit", device_map='auto', quantization_config=quantization_config)
|
39 |
-
model = PeftModel.from_pretrained(base_model, "FlawedLLM/BhashiniLLM")
|
40 |
|
41 |
|
42 |
@spaces.GPU(duration=300)
|
|
|
1 |
import re
|
2 |
import spaces
|
3 |
import gradio as gr
|
4 |
+
from transformers import AutoTokenizer, AutoModel, BitsAndBytesConfig
|
5 |
import torch
|
6 |
+
# from peft import PeftModel, PeftConfig
|
7 |
|
8 |
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini")
|
10 |
+
# quantization_config = BitsAndBytesConfig(
|
11 |
+
# load_in_4bit=True,
|
12 |
+
# bnb_4bit_use_double_quant=True,
|
13 |
+
# bnb_4bit_quant_type="nf4",
|
14 |
+
# bnb_4bit_compute_dtype=torch.float16)
|
15 |
# model = AutoModelForCausalLM.from_pretrained("FlawedLLM/BhashiniLLM",
|
16 |
# device_map="auto",
|
17 |
# quantization_config=quantization_config,
|
|
|
34 |
|
35 |
|
36 |
|
37 |
+
model = AutoModel.from_pretrained("FlawedLLM/Bhashini",device_map='auto')
|
|
|
|
|
38 |
|
39 |
|
40 |
@spaces.GPU(duration=300)
|