CreitinGameplays commited on
Commit
2f2e7ca
1 Parent(s): 610065d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -28,12 +28,15 @@ def generate_text(prompt):
28
 
29
  # Decode the generated token sequence back to text
30
  generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
 
31
  return generated_text
32
 
33
  # Define the Gradio interface
34
  interface = gr.Interface(
35
  fn=generate_text,
36
- inputs="text",
 
 
37
  outputs="text",
38
  description="Interact with BLOOM (Loaded with Hugging Face Transformers)",
39
  )
 
28
 
29
  # Decode the generated token sequence back to text
30
  generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
31
+ generated_text = generate_text.replace(prompt, "").strip()
32
  return generated_text
33
 
34
  # Define the Gradio interface
35
  interface = gr.Interface(
36
  fn=generate_text,
37
+ inputs=[
38
+ gr.Textbox(label="Text Prompt", value="<|system|> You are a helpful AI assistant </s> <|prompter|> What is an AI? </s> <|assistant|>"),
39
+ ],
40
  outputs="text",
41
  description="Interact with BLOOM (Loaded with Hugging Face Transformers)",
42
  )