johann22 commited on
Commit
e99a5b9
β€’
1 Parent(s): e6784e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -8,16 +8,17 @@ from models import models
8
  import urllib.request
9
  import uuid
10
  base_url="https://johann22-chat-diffusion.hf.space/"
 
11
  loaded_model=[]
12
  for i,model in enumerate(models):
13
  loaded_model.append(gr.load(f'models/{model}'))
14
  print (loaded_model)
15
-
16
  now = datetime.now()
17
  date_time_str = now.strftime("%Y-%m-%d %H:%M:%S")
18
 
19
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
20
- #model = gr.load("models/stabilityai/sdxl-turbo")
21
  history = []
22
 
23
  def infer(txt):
@@ -65,7 +66,7 @@ def run(purpose,history,model_drop):
65
  out_prompt = f"An Error Occured generating the prompt \n {e}"
66
  yield ("",[(purpose,out_prompt)],None)
67
  try:
68
- model=loaded_model[int(model_drop)]
69
  out_img=model(out_prompt)
70
  print(out_img)
71
  image=f'{base_url}file={out_img}'
 
8
  import urllib.request
9
  import uuid
10
  base_url="https://johann22-chat-diffusion.hf.space/"
11
+ '''
12
  loaded_model=[]
13
  for i,model in enumerate(models):
14
  loaded_model.append(gr.load(f'models/{model}'))
15
  print (loaded_model)
16
+ '''
17
  now = datetime.now()
18
  date_time_str = now.strftime("%Y-%m-%d %H:%M:%S")
19
 
20
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
21
+ model = gr.load("models/stabilityai/sdxl-turbo")
22
  history = []
23
 
24
  def infer(txt):
 
66
  out_prompt = f"An Error Occured generating the prompt \n {e}"
67
  yield ("",[(purpose,out_prompt)],None)
68
  try:
69
+ #model=loaded_model[int(model_drop)]
70
  out_img=model(out_prompt)
71
  print(out_img)
72
  image=f'{base_url}file={out_img}'