Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,11 +6,7 @@ from pydub import AudioSegment as am
|
|
| 6 |
from xml.etree import ElementTree
|
| 7 |
|
| 8 |
aoai_url, aoai_key, stts_key, stts_region = "", "", "", ""
|
| 9 |
-
|
| 10 |
openai.api_type = "azure"
|
| 11 |
-
# openai.api_base = "https://mvp-azureopenai.openai.azure.com/"
|
| 12 |
-
openai.api_version = "2023-03-15-preview"
|
| 13 |
-
# openai.api_key = aoai_key
|
| 14 |
|
| 15 |
prompts = ""
|
| 16 |
model_gpt = ""
|
|
@@ -46,16 +42,15 @@ with gr.Blocks() as page:
|
|
| 46 |
with gr.Tabs():
|
| 47 |
with gr.TabItem("Settings"):
|
| 48 |
gr.HTML("""
|
| 49 |
-
<p>Please read
|
| 50 |
-
will not be saved or viewed by anyone. <br>
|
| 51 |
-
'Enter' key. <br><br>
|
| 52 |
You can find these parameters in Azure Portal. Select Azure OpenAI resource or Cognitive Service resource like Speech, and then select
|
| 53 |
'Keys and Endpoint' from left panel. <br> For Azure OpenAI service, you need to provide the resource URL and key for REST API. You also
|
| 54 |
-
need to set the API version or just use the default value. The Azure OpenAI model which
|
| 55 |
-
you may need run different models at same time. Don't forget hit 'Enter'
|
| 56 |
-
provide Key for REST API, and also need to provide service region, for example
|
| 57 |
-
<br><br>
|
| 58 |
-
|
| 59 |
""")
|
| 60 |
with gr.Row():
|
| 61 |
with gr.Column(scale=0.6):
|
|
|
|
| 6 |
from xml.etree import ElementTree
|
| 7 |
|
| 8 |
aoai_url, aoai_key, stts_key, stts_region = "", "", "", ""
|
|
|
|
| 9 |
openai.api_type = "azure"
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
prompts = ""
|
| 12 |
model_gpt = ""
|
|
|
|
| 42 |
with gr.Tabs():
|
| 43 |
with gr.TabItem("Settings"):
|
| 44 |
gr.HTML("""
|
| 45 |
+
<p>Please read and set parameters before switching to another tab.</p> <br>Your Azure OpenAI Key and other Azure Cognitive Service Keys
|
| 46 |
+
will not be saved or viewed by anyone. <br><br>
|
|
|
|
| 47 |
You can find these parameters in Azure Portal. Select Azure OpenAI resource or Cognitive Service resource like Speech, and then select
|
| 48 |
'Keys and Endpoint' from left panel. <br> For Azure OpenAI service, you need to provide the resource URL and key for REST API. You also
|
| 49 |
+
need to set the API version or just use the default value. The Azure OpenAI model which is deployed needs to be set in each tab. Because
|
| 50 |
+
you may need to run different models at the same time. Don't forget to hit 'Enter' with every input. <br> For Azure Cognitive services,
|
| 51 |
+
you need to provide a Key for REST API, and also need to provide a service region, for example, 'westus'. The app will create the endpoint
|
| 52 |
+
URL by itself. <br><br>Thank you.<br><br><br> Azure OpenAI Service parameters for ChatGPT/GPT. Please input these settings and hit the
|
| 53 |
+
'Enter' key.
|
| 54 |
""")
|
| 55 |
with gr.Row():
|
| 56 |
with gr.Column(scale=0.6):
|