Skip to content

Commit

Permalink
add max_new_tokens (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
shifucun authored Aug 28, 2024
1 parent b1096fa commit 2c13e13
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llm/data_gemma/huggingface_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""HF Pipeline API based LLM Interface.
For example usage, see: https://huggingface.co/google/gemma-2-27b
Expand Down Expand Up @@ -81,7 +80,7 @@ def query(self, prompt: str) -> base.LLMCall:

start = time.time()
input_ids = self.tokenizer(prompt, return_tensors='pt').to('cuda')
outputs = self.model.generate(**input_ids)
outputs = self.model.generate(**input_ids, max_new_tokens=4096)

ans = ''
err = ''
Expand Down

0 comments on commit 2c13e13

Please sign in to comment.