Update README.md
Browse files
README.md
CHANGED
@@ -146,8 +146,7 @@ def is_url_or_filename(val) -> bool:
|
|
146 |
return True
|
147 |
|
148 |
def ask_about_image (model, processor, question, images_input=[], verbatim=False,temperature=0.1,show_image=False,
|
149 |
-
system="You are a materials scientist. ",
|
150 |
-
max_new_tokens=256, messages=[], images=[], use_Markdown=False):
|
151 |
|
152 |
images_input=ensure_list(images_input)
|
153 |
if len (images)==0:
|
@@ -196,15 +195,6 @@ def ask_about_image (model, processor, question, images_input=[], verbatim=Fals
|
|
196 |
|
197 |
messages.append ( {"role": "assistant", "content": [ {"type": "text", "text": generated_texts}]} )
|
198 |
|
199 |
-
formatted_conversation = format_conversation(messages, images)
|
200 |
-
|
201 |
-
# Display the formatted conversation in Jupyter Notebook
|
202 |
-
if show_conversation:
|
203 |
-
if use_Markdown:
|
204 |
-
display(Markdown(formatted_conversation))
|
205 |
-
else:
|
206 |
-
display(HTML(formatted_conversation))
|
207 |
-
|
208 |
return generated_texts, messages, images
|
209 |
|
210 |
question = """What is shown in this image, and what is the relevance for materials design? Include a discussion of multi-agent AI.
|
@@ -220,6 +210,8 @@ response, messages,images= ask_about_image ( model, processor, question,
|
|
220 |
init_instr='You carefully study the image, and respond accurately, but succinctly. Think step-by-step.\n\n',
|
221 |
show_conversation=True,
|
222 |
max_new_tokens=512, messages=[], images=[])
|
|
|
|
|
223 |
```
|
224 |
|
225 |
Sample output:
|
|
|
146 |
return True
|
147 |
|
148 |
def ask_about_image (model, processor, question, images_input=[], verbatim=False,temperature=0.1,show_image=False,
|
149 |
+
system="You are a materials scientist. ", max_new_tokens=256, messages=[], images=[], ):
|
|
|
150 |
|
151 |
images_input=ensure_list(images_input)
|
152 |
if len (images)==0:
|
|
|
195 |
|
196 |
messages.append ( {"role": "assistant", "content": [ {"type": "text", "text": generated_texts}]} )
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
return generated_texts, messages, images
|
199 |
|
200 |
question = """What is shown in this image, and what is the relevance for materials design? Include a discussion of multi-agent AI.
|
|
|
210 |
init_instr='You carefully study the image, and respond accurately, but succinctly. Think step-by-step.\n\n',
|
211 |
show_conversation=True,
|
212 |
max_new_tokens=512, messages=[], images=[])
|
213 |
+
|
214 |
+
print (response)
|
215 |
```
|
216 |
|
217 |
Sample output:
|