Closed adityasingh-0803 closed 3 weeks ago
@tarun-aiplanet please check and verify
This is isn't how the LLM support is added. Check #81
Check LLM folder. Furthermore, by Perplexity I mean perplexity.ai model using API support.
I am closing this PR, as its irrelevant code addition.
can we do it without api support
like genrating text without api support
We wrote a Python script to calculate the perplexity of a sentence using the GPT-2 model from the Hugging Face Transformers library. The script imports necessary libraries, loads the model and tokenizer, and defines a function that tokenizes input text, computes the model's loss, and derives perplexity from that loss. We tested the function with an example sentence, outputting a perplexity value that indicates how predictable the model finds the text. This process helps evaluate the model's understanding of language based on its training.