loreri commited on
Commit
d5296b5
·
verified ·
1 Parent(s): 178f145

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -19
app.py CHANGED
@@ -10,25 +10,7 @@ from TextGen import app
10
 
11
  class Generate(BaseModel):
12
  text:str
13
-
14
- def generate_text(prompt: str):
15
- if prompt == "":
16
- return {"detail": "Please provide a prompt."}
17
- else:
18
- prompt = PromptTemplate(template=prompt, input_variables=['Prompt'])
19
- llm = Clarifai(
20
- pat = config.CLARIFAI_PAT,
21
- user_id = config.USER_ID,
22
- app_id = config.APP_ID,
23
- model_id = config.MODEL_ID,
24
- model_version_id=config.MODEL_VERSION_ID,
25
- )
26
- llmchain = LLMChain(
27
- prompt=prompt,
28
- llm=llm
29
- )
30
- llm_response = llmchain.run({"Prompt": prompt})
31
- return Generate(text=llm_response)
32
 
33
  app.add_middleware(
34
  CORSMiddleware,
 
10
 
11
  class Generate(BaseModel):
12
  text:str
13
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  app.add_middleware(
16
  CORSMiddleware,