Spaces:
Runtime error
Runtime error
FlawedLLM
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -43,9 +43,11 @@ import torch
|
|
43 |
# )
|
44 |
# tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini")
|
45 |
# Load model directly
|
46 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
47 |
|
48 |
tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini_9")
|
|
|
|
|
49 |
# quantization_config = BitsAndBytesConfig(
|
50 |
# load_in_4bit=True,
|
51 |
# bnb_4bit_use_double_quant=True,
|
@@ -54,7 +56,7 @@ tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini_9")
|
|
54 |
# )
|
55 |
|
56 |
# torch_dtype =torch.float16
|
57 |
-
model = AutoModelForCausalLM.from_pretrained("FlawedLLM/Bhashini_9",ignore_mismatched_sizes=True).to('cuda')
|
58 |
|
59 |
@spaces.GPU(duration=300)
|
60 |
def chunk_it(input_command):
|
|
|
43 |
# )
|
44 |
# tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini")
|
45 |
# Load model directly
|
46 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, AutoConfig
|
47 |
|
48 |
tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini_9")
|
49 |
+
config = AutoConfig.from_pretrained(model_id) # Load configuration
|
50 |
+
|
51 |
# quantization_config = BitsAndBytesConfig(
|
52 |
# load_in_4bit=True,
|
53 |
# bnb_4bit_use_double_quant=True,
|
|
|
56 |
# )
|
57 |
|
58 |
# torch_dtype =torch.float16
|
59 |
+
model = AutoModelForCausalLM.from_pretrained("FlawedLLM/Bhashini_9",config=config, ignore_mismatched_sizes=True).to('cuda')
|
60 |
|
61 |
@spaces.GPU(duration=300)
|
62 |
def chunk_it(input_command):
|