import gradio as gr import os import sys import json import requests import glob from PIL import Image from io import BytesIO import random import numpy as np MODEL = "gpt-3.5-turbo" API_URL = os.getenv("API_URL") DISABLED = os.getenv("DISABLED") == 'True' OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") NUM_THREADS = int(16) TOTAL_K = 5 SAMPLE_IDX = [] RANDOM_POSITION = [(145 + 200 * i + 400 * (i//2), j * 110 + 900) for i in range(4) for j in range(4) ] CURRENT_POSITION = [] import os import numpy as np import torch ########### from thinkgpt.llm import ThinkGPT os.environ['OPENAI_API_KEY']='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' llm = ThinkGPT(model_name="gpt-3.5-turbo") import gradio as gr from transformers import AutoModelForCausalLM, AutoTokenizer title = """
'
else:
lines[i] = ''
else:
if i > 0:
lines[i] = "By using our app, which is powered by OpenAI's API, you acknowledge and agree to the following terms regarding the data you provide:
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.