Download app.py from Pasula/CompilerX-LLM: direct link, hf CLI and curl.
- Browser
- Download file 892 Bytes
-
https://huggingface.co/Pasula/CompilerX-LLM/resolve/main/app.py
- Command line
-
hf download hf://Pasula/CompilerX-LLM/app.py
-
curl -L -o app.py https://huggingface.co/Pasula/CompilerX-LLM/resolve/main/app.py
892 Bytes
| from transformers import pipeline | |
| def compilerx_text_generation(input_data:str): | |
| """_summary_ | |
| Takes data set from source,feeds to EleutherAI/gpt-neo-2.7B model | |
| Args: | |
| input_data (str): compilerx-data | |
| Returns: | |
| json response (dict): response based on input data. | |
| """ | |
| generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B') | |
| response = generator(input_data, max_length=50, num_return_sequences=1) | |
| print(response[0]['generated_text']) | |
| return ( | |
| { | |
| 'status': True, | |
| 'response': response[0]['generated_text'] | |
| } | |
| ) | |
| # Define your input data | |
| input_data = "Millions of Companies At Your Fingertips A premium Compiled B2B database to tap into the right contacts with buying power! We help you work smarter." | |
| response = compilerx_text_generation(input_data=input_data) | |
| print(response) | |