Nitish-py commited on
Commit
540fe46
1 Parent(s): e6877b0

url validation

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -28,12 +28,12 @@ def qa(sp,engine,message):
28
  async def factory():
29
  url = await cl.AskUserMessage(author="Beast",content="Enter url").send()
30
  print(url)
31
- if url['output'][-1]=="/":
32
- url['output']=url['output'].replace(".ai/",".ai")
33
  auth = await cl.AskUserMessage(author="Beast",content="Enter auth token").send()
34
  print(auth)
35
  model = 'deploy-llm'
36
- llm = MonsterLLM(model=model,base_url=url['output'],monster_api_key=auth['output'],temperature=0.75, context_window=1024)
37
  cl.user_session.set("llm", llm)
38
  # files = None
39
  # while files is None:
 
28
  async def factory():
29
  url = await cl.AskUserMessage(author="Beast",content="Enter url").send()
30
  print(url)
31
+ index_ai = url['output'].find("ai")
32
+ url_ai = url['output'][:index_ai + 2]
33
  auth = await cl.AskUserMessage(author="Beast",content="Enter auth token").send()
34
  print(auth)
35
  model = 'deploy-llm'
36
+ llm = MonsterLLM(model=model,base_url=url_ai,monster_api_key=auth['output'],temperature=0.75, context_window=1024)
37
  cl.user_session.set("llm", llm)
38
  # files = None
39
  # while files is None: