adyaprasad commited on
Commit
97d98e2
·
verified ·
1 Parent(s): cc17b1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,13 +11,13 @@ pipe = pipeline("text2text-generation", model="google/flan-t5-small")
11
  #creating routes
12
  @app.get("/")
13
  def home():
14
- return {"Gearing Up! at Homepage"}
15
 
16
  #define a function to handle the GET request at '/generate'
17
  @app.get("/generate")
18
  def generate(text: str):
19
  # use the pipeline to generate text from given input text
20
- output = pipe(text, max_new_tokens=50, temperature=0.7, top_k=50) # Adjust parameters as needed
21
  print(output) # Debugging line
22
  #return the correct key based on model output
23
  return {"output": output[0]['generated_text']}
 
11
  #creating routes
12
  @app.get("/")
13
  def home():
14
+ return {"message": "Your FastAPI and Model is Running"}
15
 
16
  #define a function to handle the GET request at '/generate'
17
  @app.get("/generate")
18
  def generate(text: str):
19
  # use the pipeline to generate text from given input text
20
+ output = pipe(text, max_new_tokens=150, temperature=0.3, top_k=30) # Adjust these parameters as per your output accuracy
21
  print(output) # Debugging line
22
  #return the correct key based on model output
23
  return {"output": output[0]['generated_text']}