Update app.py
Browse files
app.py
CHANGED
|
@@ -19,20 +19,12 @@ import requests
|
|
| 19 |
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
| 20 |
MODEL = 'llama3-groq-70b-8192-tool-use-preview'
|
| 21 |
|
| 22 |
-
# Configure BitsAndBytes for 4-bit quantization
|
| 23 |
-
bnb_config = BitsAndBytesConfig(
|
| 24 |
-
load_in_4bit=True,
|
| 25 |
-
bnb_4bit_use_double_quant=True,
|
| 26 |
-
bnb_4bit_quant_type="nf4",
|
| 27 |
-
bnb_4bit_compute_dtype=torch.bfloat16
|
| 28 |
-
)
|
| 29 |
-
|
| 30 |
############### MINICPM MEIN ERROR HAI, USKO REPLACE KARNA HOGA ###############
|
| 31 |
|
| 32 |
# Load MiniCPM-V-2_6 with 4-bit quantization
|
| 33 |
-
text_model = AutoModel.from_pretrained('openbmb/MiniCPM-V-
|
| 34 |
-
|
| 35 |
-
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V-
|
| 36 |
|
| 37 |
tts_model = ParlerTTSForConditionalGeneration.from_pretrained("parler-tts/parler-tts-large-v1").to('cuda')
|
| 38 |
tts_tokenizer = AutoTokenizer.from_pretrained("parler-tts/parler-tts-large-v1")
|
|
|
|
| 19 |
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
| 20 |
MODEL = 'llama3-groq-70b-8192-tool-use-preview'
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
############### MINICPM MEIN ERROR HAI, USKO REPLACE KARNA HOGA ###############
|
| 23 |
|
| 24 |
# Load MiniCPM-V-2_6 with 4-bit quantization
|
| 25 |
+
text_model = AutoModel.from_pretrained('openbmb/MiniCPM-V-2', trust_remote_code=True,
|
| 26 |
+
device_map="auto", dtype=torch.float16)
|
| 27 |
+
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V-2', trust_remote_code=True)
|
| 28 |
|
| 29 |
tts_model = ParlerTTSForConditionalGeneration.from_pretrained("parler-tts/parler-tts-large-v1").to('cuda')
|
| 30 |
tts_tokenizer = AutoTokenizer.from_pretrained("parler-tts/parler-tts-large-v1")
|