akhaliq HF staff commited on
Commit
be25d96
1 Parent(s): 39f7657

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
  from PIL import Image
3
- import requests
4
  import os
5
  from together import Together
6
  import base64
@@ -54,15 +53,14 @@ def generate_gradio_app(api_key, image):
54
  8. Provide a runnable Gradio application focusing on the most important aspects of the UI.
55
  9. Keep the code concise, aiming for no more than 2000 tokens.
56
 
57
- Please generate the Gradio code based on the provided image, focusing on the most crucial elements to fit within the token limit."""
 
 
58
 
59
  messages = [
60
  {
61
  "role": "user",
62
- "content": [
63
- {"type": "text", "text": prompt},
64
- {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{encoded_image}"}}
65
- ]
66
  }
67
  ]
68
 
 
1
  import gradio as gr
2
  from PIL import Image
 
3
  import os
4
  from together import Together
5
  import base64
 
53
  8. Provide a runnable Gradio application focusing on the most important aspects of the UI.
54
  9. Keep the code concise, aiming for no more than 2000 tokens.
55
 
56
+ Please generate the Gradio code based on the provided image, focusing on the most crucial elements to fit within the token limit.
57
+
58
+ [IMAGE]data:image/jpeg;base64,{encoded_image}[/IMAGE]"""
59
 
60
  messages = [
61
  {
62
  "role": "user",
63
+ "content": prompt
 
 
 
64
  }
65
  ]
66