Spaces:
Runtime error
Runtime error
FlawedLLM
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,13 @@
|
|
1 |
import re
|
2 |
from unsloth import FastLanguageModel
|
|
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
max_seq_length = max_seq_length,
|
10 |
-
dtype = dtype,
|
11 |
-
load_in_4bit = load_in_4bit,
|
12 |
-
)
|
13 |
-
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
14 |
-
|
15 |
@spaces.GPU
|
16 |
def chunk_it(input_command):
|
17 |
inputs = tokenizer(
|
|
|
1 |
import re
|
2 |
from unsloth import FastLanguageModel
|
3 |
+
from peft import PeftModel, PeftConfig
|
4 |
+
from transformers import AutoModelForCausalLM
|
5 |
|
6 |
+
config = PeftConfig.from_pretrained("FlawedLLM/BhashiniLLM")
|
7 |
+
base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-bnb-4bit")
|
8 |
+
model = PeftModel.from_pretrained(base_model, "FlawedLLM/BhashiniLLM")
|
9 |
+
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/BhashiniLLM")
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
@spaces.GPU
|
12 |
def chunk_it(input_command):
|
13 |
inputs = tokenizer(
|