import gradio as gr
import sys
import subprocess
import os
sys.path.append("./")
sys.path.append("../")
import BotSimulator
from BotSimulator import TootBot
import openai
from io import StringIO
import multiprocessing
restore_point=sys.stdout
if not os.path.exists("data/fake-tweets"):
os.makedirs("data/fake-tweets")
if not os.path.exists("data/failed-tweets"):
os.makedirs("data/failed-tweets")
if not os.path.exists("images"):
os.makedirs("images")
title = """
By using our app, which is powered by OpenAI's API, you acknowledge and agree to the following terms regarding the data you provide:
- Collection: We may collect information, including the inputs you type into our app, the outputs generated by OpenAI's API, and certain technical details about your device and connection (such as browser type, operating system, and IP address) provided by your device's request headers.
- Use: We may use the collected data for research purposes, to improve our services, and to develop new products or services, including commercial applications, and for security purposes, such as protecting against unauthorized access and attacks.
- Sharing and Publication: Your data, including the technical details collected from your device's request headers, may be published, shared with third parties, or used for analysis and reporting purposes.
- Data Retention: We may retain your data, including the technical details collected from your device's request headers, for as long as necessary.
By continuing to use our app, you provide your explicit consent to the collection, use, and potential sharing of your data as described above. If you do not agree with our data collection, use, and sharing practices, please do not use our app.
""")
accept_button = gr.Button("I Agree")
def enable_inputs():
return user_consent_block.update(visible=False), main_block.update(visible=True)
accept_button.click(None, None, accept_checkbox, _js=js, queue=False)
accept_checkbox.change(fn=enable_inputs, inputs=[], outputs=[user_consent_block, main_block], queue=False)
# demo.queue(concurrency_count=1, max_size=num_processes)
demo.launch(share=False, show_api=False)