Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import gradio as gr
|
| 4 |
import random
|
| 5 |
-
import
|
| 6 |
|
| 7 |
checkpoint = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 8 |
client = InferenceClient(checkpoint)
|
|
@@ -12,8 +12,8 @@ def format_prompt(raw_Prompt):
|
|
| 12 |
return better_prompt
|
| 13 |
|
| 14 |
|
| 15 |
-
def findShops(target_platform, target_region, target_field, target_rangeFrom, target_rangeTo, target_crossSelling, target_similarArticles, target_amount,accessKey
|
| 16 |
-
if accessKey !=
|
| 17 |
return 'You are not authorized to use this software.'
|
| 18 |
requestPrompt = f"""
|
| 19 |
Search for {target_amount} Shops that use the platform {target_platform}.
|
|
@@ -121,8 +121,6 @@ with gr.Blocks(title="Shop finder",
|
|
| 121 |
interactive=True,
|
| 122 |
type='password',
|
| 123 |
show_label=False)
|
| 124 |
-
loginSecret = gr.Textbox(value = os.environ.getattribute("ACCESS_TOKEN"),
|
| 125 |
-
visible= False)
|
| 126 |
btn.click(fn=findShops,
|
| 127 |
inputs=[platform, region, field,
|
| 128 |
range_from, range_to,
|
|
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import gradio as gr
|
| 4 |
import random
|
| 5 |
+
import streamlit as st
|
| 6 |
|
| 7 |
checkpoint = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 8 |
client = InferenceClient(checkpoint)
|
|
|
|
| 12 |
return better_prompt
|
| 13 |
|
| 14 |
|
| 15 |
+
def findShops(target_platform, target_region, target_field, target_rangeFrom, target_rangeTo, target_crossSelling, target_similarArticles, target_amount,accessKey):
|
| 16 |
+
if accessKey != st.secrets["ACCESS_TOKEN"]:
|
| 17 |
return 'You are not authorized to use this software.'
|
| 18 |
requestPrompt = f"""
|
| 19 |
Search for {target_amount} Shops that use the platform {target_platform}.
|
|
|
|
| 121 |
interactive=True,
|
| 122 |
type='password',
|
| 123 |
show_label=False)
|
|
|
|
|
|
|
| 124 |
btn.click(fn=findShops,
|
| 125 |
inputs=[platform, region, field,
|
| 126 |
range_from, range_to,
|