arjunanand13 commited on
Commit
868ca3b
1 Parent(s): 1a8e9fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -97,17 +97,17 @@ class StopOnTokens(StoppingCriteria):
97
  stopping_criteria = StoppingCriteriaList([StopOnTokens()])
98
 
99
 
100
- # generate_text = transformers.pipeline(
101
- # model=model,
102
- # tokenizer=tokenizer,
103
- # return_full_text=True, # langchain expects the full text
104
- # task='text-generation',
105
- # # we pass model parameters here too
106
- # stopping_criteria=stopping_criteria, # without this model rambles during chat
107
- # temperature=0.1, # 'randomness' of outputs, 0.0 is the min and 1.0 the max
108
- # max_new_tokens=512, # max number of tokens to generate in the output
109
- # repetition_penalty=1.1 # without this output begins repeating
110
- # )
111
 
112
  llm = HuggingFacePipeline(pipeline=generate_text)
113
 
 
97
  stopping_criteria = StoppingCriteriaList([StopOnTokens()])
98
 
99
 
100
+ generate_text = transformers.pipeline(
101
+ model=model,
102
+ tokenizer=tokenizer,
103
+ return_full_text=True, # langchain expects the full text
104
+ task='text-generation',
105
+ # we pass model parameters here too
106
+ stopping_criteria=stopping_criteria, # without this model rambles during chat
107
+ temperature=0.1, # 'randomness' of outputs, 0.0 is the min and 1.0 the max
108
+ max_new_tokens=512, # max number of tokens to generate in the output
109
+ repetition_penalty=1.1 # without this output begins repeating
110
+ )
111
 
112
  llm = HuggingFacePipeline(pipeline=generate_text)
113