Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,7 @@ api_url = os.getenv('yolo')
|
|
31 |
model = os.getenv('model')
|
32 |
image_model = os.getenv('model2')
|
33 |
mongoURI = os.getenv('MONGO_URI')
|
|
|
34 |
|
35 |
# OpenAI and MongoDB clients
|
36 |
openai_client = OpenAI(api_key=openai_api_key, base_url=api_url)
|
@@ -96,7 +97,7 @@ def encode_local_image(image_file):
|
|
96 |
def inference_calling_idefics(image_path, question=""):
|
97 |
system_prompt = os.getenv('USER_PROMPT')
|
98 |
model_id = image_model
|
99 |
-
client = InferenceClient(
|
100 |
|
101 |
# Use the fixed `encode_local_image` to encode the image
|
102 |
image_base64 = encode_local_image(image_path)
|
|
|
31 |
model = os.getenv('model')
|
32 |
image_model = os.getenv('model2')
|
33 |
mongoURI = os.getenv('MONGO_URI')
|
34 |
+
hf_token = os.getenv('hf_token')
|
35 |
|
36 |
# OpenAI and MongoDB clients
|
37 |
openai_client = OpenAI(api_key=openai_api_key, base_url=api_url)
|
|
|
97 |
def inference_calling_idefics(image_path, question=""):
|
98 |
system_prompt = os.getenv('USER_PROMPT')
|
99 |
model_id = image_model
|
100 |
+
client = InferenceClient(api_key=hf_token)
|
101 |
|
102 |
# Use the fixed `encode_local_image` to encode the image
|
103 |
image_base64 = encode_local_image(image_path)
|