Update app.py
Browse files
app.py
CHANGED
@@ -51,10 +51,17 @@ processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
51 |
model = LlavaForConditionalGeneration.from_pretrained(MODEL_ID, quantization_config=quantization_config, device_map="auto")
|
52 |
# Pass the tokenizer explicitly to the pipeline
|
53 |
# Pass the image processor explicitly to the pipeline
|
54 |
-
pipe_image_to_text = pipeline("image-to-text", model=model, tokenizer=tokenizer_image_to_text, image_processor=image_processor, model_kwargs={"quantization_config": quantization_config})
|
55 |
# Initialize the text generation pipeline
|
56 |
-
pipe_text = pipeline("text-generation", model=TEXT_MODEL_ID, model_kwargs={"quantization_config": quantization_config})
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
# Ensure data files are available
|
59 |
current_directory = os.getcwd()
|
60 |
geocoded_hotels_path = os.path.join(current_directory, 'geocoded_hotels.csv')
|
|
|
51 |
model = LlavaForConditionalGeneration.from_pretrained(MODEL_ID, quantization_config=quantization_config, device_map="auto")
|
52 |
# Pass the tokenizer explicitly to the pipeline
|
53 |
# Pass the image processor explicitly to the pipeline
|
54 |
+
#pipe_image_to_text = pipeline("image-to-text", model=model, tokenizer=tokenizer_image_to_text, image_processor=image_processor, model_kwargs={"quantization_config": quantization_config})
|
55 |
# Initialize the text generation pipeline
|
|
|
56 |
|
57 |
+
pipe_text = pipeline(
|
58 |
+
"text-generation",
|
59 |
+
model=TEXT_MODEL_ID,
|
60 |
+
model_kwargs={
|
61 |
+
"quantization_config": quantization_config,
|
62 |
+
"use_auth_token": True # This will use the environment variable
|
63 |
+
}
|
64 |
+
)
|
65 |
# Ensure data files are available
|
66 |
current_directory = os.getcwd()
|
67 |
geocoded_hotels_path = os.path.join(current_directory, 'geocoded_hotels.csv')
|