lilyhof commited on
Commit
eb7e4f2
1 Parent(s): 819c471

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -1,14 +1,10 @@
1
  import gradio as gr
2
  import openai
3
- import os
4
 
5
- # Set the environment variables
6
- os.environ["OPENAI_API_KEY"] = INSTRUCTOR_API_KEY
7
- os.environ["INSTRUCTOR_PROMPT"] = INSTRUCTOR_PROMPT
8
-
9
- # Retrieve the API key and instructor prompt from environment variables
10
- api_key = os.environ.get("OPENAI_API_KEY")
11
- instructor_prompt = os.environ.get("INSTRUCTOR_PROMPT")
12
 
13
  with gr.Blocks() as demo:
14
  chat_history = gr.State(value=[])
 
1
  import gradio as gr
2
  import openai
3
+ import hf
4
 
5
+ # Retrieve the API key from the Hugging Face secret
6
+ api_key = hf.secrets.get("INSTRUCTOR_API_KEY")
7
+ instructor_prompt = hf.secrets.get("INSTRUCTOR_PROMPT")
 
 
 
 
8
 
9
  with gr.Blocks() as demo:
10
  chat_history = gr.State(value=[])