Ctaake commited on
Commit
e056cb6
·
verified ·
1 Parent(s): d468e57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,14 +6,13 @@ import random
6
  checkpoint = "mistralai/Mixtral-8x7B-Instruct-v0.1"
7
  client = InferenceClient(checkpoint)
8
 
9
-
10
  def format_prompt(raw_Prompt):
11
  better_prompt = f"[INST] {raw_Prompt} [/INST]"
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,compareSecret,ACCESS_TOKEN=ACCESS_TOKEN):
16
- if compareSecret != 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}.
@@ -117,17 +116,19 @@ with gr.Blocks(title="Shop finder",
117
  label='POTENTIAL SHOPS')
118
  with gr.Group():
119
  gr.Markdown("*ACCESS SECRET*")
120
- loginSecret = gr.Textbox(max_lines=1,
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,
127
  opt_crossSelling,
128
  opt_similarArticles,
129
  numberOfShops,
130
- loginSecret],
131
  outputs=out)
132
 
133
  demo.launch(show_api=False)
 
6
  checkpoint = "mistralai/Mixtral-8x7B-Instruct-v0.1"
7
  client = InferenceClient(checkpoint)
8
 
 
9
  def format_prompt(raw_Prompt):
10
  better_prompt = f"[INST] {raw_Prompt} [/INST]"
11
  return better_prompt
12
 
13
 
14
+ def findShops(target_platform, target_region, target_field, target_rangeFrom, target_rangeTo, target_crossSelling, target_similarArticles, target_amount,accessKey,accessSecret):
15
+ if accessKey != accessSecret:
16
  return 'You are not authorized to use this software.'
17
  requestPrompt = f"""
18
  Search for {target_amount} Shops that use the platform {target_platform}.
 
116
  label='POTENTIAL SHOPS')
117
  with gr.Group():
118
  gr.Markdown("*ACCESS SECRET*")
119
+ loginKey = gr.Textbox(max_lines=1,
120
  interactive=True,
121
  type='password',
122
  show_label=False)
123
+ loginSecret = gr.Textbox(value = ACCESS_TOKEN,
124
+ visible= False)
125
  btn.click(fn=findShops,
126
  inputs=[platform, region, field,
127
  range_from, range_to,
128
  opt_crossSelling,
129
  opt_similarArticles,
130
  numberOfShops,
131
+ accessKey,accessSecret],
132
  outputs=out)
133
 
134
  demo.launch(show_api=False)