Spaces:
Runtime error
Runtime error
| from __future__ import annotations | |
| import openai | |
| import gradio as gr | |
| import os | |
| import re | |
| import numpy as np | |
| import pandas as pd | |
| import pickle | |
| import tiktoken | |
| from datasets import load_dataset | |
| from git import Repo | |
| # Set OpenAI API key | |
| openai.api_key = os.getenv("OPENAI_API_KEY") | |
| # Clone the repository | |
| PAT = os.getenv("PATKEY") | |
| repo = Repo.clone_from("https://mcbrs1a:" + PAT + "@github.com/mcbrs1a/AskQ.git", "A") | |
| # Import the updated insidecode module | |
| import A.insidecode | |
| # Gradio app setup | |
| with gr.Blocks() as app: | |
| with gr.Row(): | |
| password_input = gr.Textbox(label="Password", type="password") | |
| question_input = gr.Textbox(label="Question") | |
| submit_button = gr.Button("Ask \"Q\"") | |
| output_field = gr.Textbox(label="Answer") | |
| submit_button.click(A.insidecode.chatbot_with_password, inputs=[question_input, password_input], outputs=output_field) | |
| # Launch the app | |
| app.launch() | |
| ########### | |
| ##### | |
| ######### | |