piyushgrover commited on
Commit
abaf27c
·
2 Parent(s): fe25480 785d8b1

Merge branch 'main' of https://huggingface.co/spaces/piyushgrover/PhiGPT into main

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -31,8 +31,8 @@ gen = pipeline('text-generation', model=model, tokenizer=tokenizer, max_length=3
31
 
32
 
33
  def fn_query_on_load():
34
- prompt = "Explain nuclear physics to a five year old kid."
35
- return prompt
36
 
37
 
38
  def generate_response(input):
@@ -40,8 +40,10 @@ def generate_response(input):
40
  prompt = f"### Human: {input}\n\n### Assistant: "
41
  result = gen(prompt)
42
 
43
- resp = result[0]['generated_text'].replace(prompt, '')
44
- resp_arr = resp.split('###')
 
 
45
 
46
  final_resp = resp_arr[0]
47
 
 
31
 
32
 
33
  def fn_query_on_load():
34
+ input = "Explain nuclear physics to a five year old kid."
35
+ return input
36
 
37
 
38
  def generate_response(input):
 
40
  prompt = f"### Human: {input}\n\n### Assistant: "
41
  result = gen(prompt)
42
 
43
+ resp = result[0]['generated_text']
44
+ print(resp)
45
+ resp_arr = resp.replace(prompt, '').split('###')
46
+ print(resp_arr)
47
 
48
  final_resp = resp_arr[0]
49