sanjanatule commited on
Commit
4be1f1a
·
1 Parent(s): 0b8f38a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -22,7 +22,9 @@ def generate_dialogue(input_text):
22
 
23
  pipe = pipeline(task="text-generation",model=model,tokenizer=tokenizer,max_length=200)
24
  result = pipe(f"<s>[INST] {input_text} [/INST]")
25
- return result[0]['generated_text']
 
 
26
 
27
  HTML_TEMPLATE = """
28
  <style>
@@ -77,7 +79,7 @@ HTML_TEMPLATE = """
77
  <div class="artifact large"></div>
78
  <div class="artifact large"></div>
79
  <!-- Content -->
80
- <h1>CHAT with fine tuned Phi-2 LLM</h1>
81
  <p>Generate dialogue for given some initial prompt for context.</p>
82
  <p>Model: Phi-2 (https://huggingface.co/microsoft/phi-2), Dataset: oasst1 (https://huggingface.co/datasets/OpenAssistant/oasst1) </p>
83
  """
 
22
 
23
  pipe = pipeline(task="text-generation",model=model,tokenizer=tokenizer,max_length=200)
24
  result = pipe(f"<s>[INST] {input_text} [/INST]")
25
+
26
+ return_answer = (result[0]['generated_text']).split('[s]')[1].split('[/s]')[0]
27
+ return return_answer
28
 
29
  HTML_TEMPLATE = """
30
  <style>
 
79
  <div class="artifact large"></div>
80
  <div class="artifact large"></div>
81
  <!-- Content -->
82
+ <h1>CHAT with Fine Tuned Phi-2 LLM</h1>
83
  <p>Generate dialogue for given some initial prompt for context.</p>
84
  <p>Model: Phi-2 (https://huggingface.co/microsoft/phi-2), Dataset: oasst1 (https://huggingface.co/datasets/OpenAssistant/oasst1) </p>
85
  """