Chan-Y commited on
Commit
07d8aa1
1 Parent(s): bd7297f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -9
app.py CHANGED
@@ -16,20 +16,12 @@ from llama_index.core import Settings
16
  from llama_index.core.node_parser import SentenceSplitter
17
  import fitz
18
  from docx import Document as DocxDocument
19
- from transformers import BitsAndBytesConfig
20
-
21
- quantization_config = BitsAndBytesConfig(
22
- load_in_4bit=True,
23
- bnb_4bit_compute_dtype=torch.float16,
24
- bnb_4bit_quant_type="nf4",
25
- bnb_4bit_use_double_quant=True,
26
- )
27
  # Configuration settings
28
  llm = HuggingFaceLLM(model_name=MODEL_NAME,
29
  tokenizer_name=MODEL_NAME,
30
  system_prompt=SYSTEM_PROMPT,
31
  context_window=CONTEXT_WINDOW,
32
- model_kwargs={"quantization_config": quantization_config},
33
  generate_kwargs={"temperature": TEMPERATURE},
34
  device_map=DEVICE)
35
  embedding = HuggingFaceEmbedding(model_name=EMBEDDING_NAME,
 
16
  from llama_index.core.node_parser import SentenceSplitter
17
  import fitz
18
  from docx import Document as DocxDocument
19
+
 
 
 
 
 
 
 
20
  # Configuration settings
21
  llm = HuggingFaceLLM(model_name=MODEL_NAME,
22
  tokenizer_name=MODEL_NAME,
23
  system_prompt=SYSTEM_PROMPT,
24
  context_window=CONTEXT_WINDOW,
 
25
  generate_kwargs={"temperature": TEMPERATURE},
26
  device_map=DEVICE)
27
  embedding = HuggingFaceEmbedding(model_name=EMBEDDING_NAME,