Skip to content

Commit

Permalink
Merge pull request shroominic#98 from tjroamer/main
Browse files Browse the repository at this point in the history
Use ProactorEventLoop to run frontend app on Windows
  • Loading branch information
shroominic authored Aug 23, 2023
2 parents 24e41b5 + 3f92983 commit 0feb803
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import sys

import streamlit as st # type: ignore

Expand Down Expand Up @@ -29,4 +30,9 @@

# This will display the images only when the button is pressed
if button_pressed and input_text != "":
asyncio.run(get_images(input_text, files=uploaded_files_list))
if sys.platform == "win32":
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
loop.run_until_complete(get_images(input_text, files=uploaded_files_list))
else:
asyncio.run(get_images(input_text, files=uploaded_files_list))

0 comments on commit 0feb803

Please sign in to comment.