Spaces:
Configuration error
Configuration error
aasherkamal216
commited on
Update test4.py
Browse files
test4.py
CHANGED
|
@@ -133,7 +133,7 @@ def messages_to_gemini(messages):
|
|
| 133 |
try:
|
| 134 |
with st.spinner(f"Sending {content['type'].replace('_', ' ')} to Gemini..."):
|
| 135 |
file = genai.upload_file(path=temp_file_path)
|
| 136 |
-
while
|
| 137 |
st.write('##----*---##')
|
| 138 |
time.sleep(10)
|
| 139 |
gemini_message["parts"].append(file)
|
|
|
|
| 133 |
try:
|
| 134 |
with st.spinner(f"Sending {content['type'].replace('_', ' ')} to Gemini..."):
|
| 135 |
file = genai.upload_file(path=temp_file_path)
|
| 136 |
+
while file.state.name == "PROCESSING":
|
| 137 |
st.write('##----*---##')
|
| 138 |
time.sleep(10)
|
| 139 |
gemini_message["parts"].append(file)
|