Nathan Butters commited on
Commit
61c67e5
·
1 Parent(s): 0ba9733

tweaking img access for api

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -50,12 +50,14 @@ picture = st.camera_input("Take a picture of your math work", disabled=not enabl
50
 
51
  if picture is not None:
52
  temp_dir = tempfile.TemporaryDirectory()
53
- temp_image_path = "." + temp_dir.name + "/" + picture.name
54
  with open(temp_image_path, "wb") as f:
55
  f.write(picture.getvalue())
56
 
57
  # Get image URL
58
- logger.info(temp_image_path)
59
- guidedMM(st.session_state.systemPrompt, temp_image_path)
 
 
60
  else:
61
  basicChat()
 
50
 
51
  if picture is not None:
52
  temp_dir = tempfile.TemporaryDirectory()
53
+ temp_image_path = temp_dir.name + "/" + picture.name
54
  with open(temp_image_path, "wb") as f:
55
  f.write(picture.getvalue())
56
 
57
  # Get image URL
58
+ base_url = requests.get(https://ipv4.icanhazip.com)
59
+ img_url = f"https://{base_url}/" + temp_image_path
60
+ logger.info(img_url)
61
+ guidedMM(st.session_state.systemPrompt, img_url)
62
  else:
63
  basicChat()