prathammk commited on
Commit
89f0c44
·
verified ·
1 Parent(s): 35444a4

Update helpers/llm_helper.py

Browse files
Files changed (1) hide show
  1. helpers/llm_helper.py +9 -6
helpers/llm_helper.py CHANGED
@@ -8,13 +8,16 @@ def analyze_image_file(image_file, model, user_prompt):
8
  # gets image bytes using helper function
9
  image_bytes = get_image_bytes(image_file)
10
 
11
- # calls the llava model using Ollama SDK
12
- stream = generate(model=model,
13
- prompt=user_prompt,
14
- images=[image_bytes],
15
- stream=True)
 
 
16
 
17
- return stream
 
18
 
19
  # handles stream response back from LLM
20
  def stream_parser(stream):
 
8
  # gets image bytes using helper function
9
  image_bytes = get_image_bytes(image_file)
10
 
11
+ # API call to remote Ollama server (update with actual URL)
12
+ url = 'https://502f-2401-4900-882d-894-a2-f66f-ba2b-969f.ngrok-free.app'
13
+ data = {
14
+ 'model': model,
15
+ 'prompt': user_prompt,
16
+ 'image_bytes': image_bytes
17
+ }
18
 
19
+ response = requests.post(url, json=data)
20
+ return response.json()
21
 
22
  # handles stream response back from LLM
23
  def stream_parser(stream):