alibidaran's picture
Update README.md
5bddbad verified
---
library_name: transformers
tags:
- unsloth
- trl
- sft
license: mit
datasets:
- nvidia/OpenCodeReasoning
language:
- en
base_model:
- unsloth/Meta-Llama-3.1-8B
---
### Direct Use
```python
from unsloth import FastLanguageModel
from transformers import (
pipeline,
logging,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
logging.set_verbosity(logging.CRITICAL)
# Run text generation pipeline with our next model
prompt="""
You are expert python programmer. You need to write a function based on the given <description>
<description>
You are given a sequence of positive integers a1, a2, ..., an. Find all such indices i, that the i-th element equals the arithmetic mean of all other elements (that is all elements except for this one).\nInput\n\nThe first line contains the integer n (2 ≤ n ≤ 2·105). The second line contains elements of the sequence a1, a2, ..., an (1 ≤ ai ≤ 1000). All the elements are positive integers.\n\nOutput\n\nPrint on the first line the number of the sought indices. Print on the second line the sought indices in the increasing order. All indices are integers from 1 to n.\n\nIf the sought elements do not exist, then the first output line should contain number 0. In this case you may either not print the second line or print an empty line.\n\nExamples\n\nInput\n\n5\n1 2 3 4 5\n\n\nOutput\n\n1\n3 \n\nInput\n\n4\n50 50 50 50\n\n\nOutput\n\n4\n1 2 3 4</description>
<output>
"""
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=3000,do_sample=True,top_k=10,top_p=0.9)
result = pipe(prompt)
print(result[0]['generated_text'])