FlawedLLM
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,21 +42,26 @@ import torch
|
|
| 42 |
# load_in_4bit = True,
|
| 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("FlawedLLM/Bhashini_9") # Load configuration
|
| 50 |
|
| 51 |
-
# quantization_config = BitsAndBytesConfig(
|
| 52 |
-
# load_in_4bit=True,
|
| 53 |
-
# bnb_4bit_use_double_quant=True,
|
| 54 |
-
# bnb_4bit_quant_type="nf4",
|
| 55 |
-
# bnb_4bit_compute_dtype=torch.float16
|
| 56 |
-
# )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
-
model = AutoModelForCausalLM.from_pretrained("FlawedLLM/
|
| 60 |
|
| 61 |
@spaces.GPU(duration=300)
|
| 62 |
def chunk_it(input_command):
|
|
|
|
| 42 |
# load_in_4bit = True,
|
| 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("FlawedLLM/Bhashini_9") # Load configuration
|
| 50 |
|
| 51 |
+
# # quantization_config = BitsAndBytesConfig(
|
| 52 |
+
# # load_in_4bit=True,
|
| 53 |
+
# # bnb_4bit_use_double_quant=True,
|
| 54 |
+
# # bnb_4bit_quant_type="nf4",
|
| 55 |
+
# # bnb_4bit_compute_dtype=torch.float16
|
| 56 |
+
# # )
|
| 57 |
+
|
| 58 |
+
# # torch_dtype =torch.float16
|
| 59 |
+
# model = AutoModelForCausalLM.from_pretrained("FlawedLLM/Bhashini_9",config=config, ignore_mismatched_sizes=True).to('cuda')
|
| 60 |
+
# Load model directly
|
| 61 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 62 |
|
| 63 |
+
tokenizer = AutoTokenizer.from_pretrained("FlawedLLM/Bhashini_00")
|
| 64 |
+
model = AutoModelForCausalLM.from_pretrained("FlawedLLM/Bhashini_00").to('cuda')
|
| 65 |
|
| 66 |
@spaces.GPU(duration=300)
|
| 67 |
def chunk_it(input_command):
|