broadfield commited on
Commit
77b9727
·
verified ·
1 Parent(s): 15f13d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -106,14 +106,15 @@ def generate(prompt,history,mod=2,tok=4000,seed=1,role="ASSISTANT",data=None):
106
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
107
  for response in stream:
108
  output += response.token.text
 
109
  print(response)
110
- reponame=""
111
- filename=""
112
- filecontent=""
113
 
114
- yield output
115
- yield history
116
- yield prompt
117
  #with open(f'{loc_folder}/{loc_file}.json','w') as jobj:
118
  # lod.append({'prompt':prompt,'response':output,'image':im_box,'model':clients[1]['name'],'seed':seed}),
119
  # jobj.write(json.dumps(lod,indent=4))
@@ -197,7 +198,8 @@ def agent(prompt_in,history,mod=2):
197
  fn="NONE"
198
  if 'CREATE_FILE' in fn:
199
  print('CREATE_FILE called')
200
- out_w =generate(com,history,mod=mod,tok=10000,seed=seed,role="CREATE_FILE",data=in_data)
 
201
  build_space(out_w[0],out_w[1],out_w[2])
202
  elif 'IMAGE' in fn:
203
  print('IMAGE called')
 
106
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
107
  for response in stream:
108
  output += response.token.text
109
+ #print(file_content)
110
  print(response)
111
+ yield reponame='test1'
112
+ yield filename=data[1]
113
+ yield filecontent=response
114
 
115
+ #yield output
116
+ #yield history
117
+ #yield prompt
118
  #with open(f'{loc_folder}/{loc_file}.json','w') as jobj:
119
  # lod.append({'prompt':prompt,'response':output,'image':im_box,'model':clients[1]['name'],'seed':seed}),
120
  # jobj.write(json.dumps(lod,indent=4))
 
198
  fn="NONE"
199
  if 'CREATE_FILE' in fn:
200
  print('CREATE_FILE called')
201
+ in_data[1]=com
202
+ out_w =generate(prompt,history,mod=mod,tok=10000,seed=seed,role="CREATE_FILE",data=in_data)
203
  build_space(out_w[0],out_w[1],out_w[2])
204
  elif 'IMAGE' in fn:
205
  print('IMAGE called')