inoid commited on
Commit
087e3b8
1 Parent(s): 7c7596b

Fix error in generate

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,12 +20,12 @@ import gradio as gr
20
  #iface.launch()
21
 
22
  def generate_model(name):
23
- return f"Welcome to Gradio, {name}!"
24
 
25
  def generate(prompt):
26
- from diffusers import StableDiffusionPipeline
27
 
28
- pipe = StableDiffusionPipeline.from_pretrained("./output_model", torch_dtype=torch.float16)
29
  pipe = pipe.to("cuda")
30
  image = pipe(prompt).images[0]
31
  return(image)
@@ -36,7 +36,7 @@ def evaluate_model():
36
  #pipe = StableDiffusionPipeline.from_pretrained("./output_model", torch_dtype=torch.float16)
37
  #pipe = pipe.to("cuda")
38
  #image = pipe(prompt).images[0]
39
- return("Evaluate Model")
40
 
41
  def train_model(*inputs):
42
  if "IS_SHARED_UI" in os.environ:
 
20
  #iface.launch()
21
 
22
  def generate_model(name):
23
+ return f"Welcome to Gradio HF_ACCES_TOKEN, {os.environ.get('HG_FACE_TOKEN')}!"
24
 
25
  def generate(prompt):
26
+ #from diffusers import StableDiffusionPipeline
27
 
28
+ #pipe = StableDiffusionPipeline.from_pretrained("./output_model", torch_dtype=torch.float16)
29
  pipe = pipe.to("cuda")
30
  image = pipe(prompt).images[0]
31
  return(image)
 
36
  #pipe = StableDiffusionPipeline.from_pretrained("./output_model", torch_dtype=torch.float16)
37
  #pipe = pipe.to("cuda")
38
  #image = pipe(prompt).images[0]
39
+ return(f"Evaluate Model {os.environ.get('HF_LLM_MODEL_ID')} from dataset {os.environ.get('HF_LLM_DATASET_ID')}")
40
 
41
  def train_model(*inputs):
42
  if "IS_SHARED_UI" in os.environ: