aiplanethub / beyondllm

Build, evaluate and observe LLM apps
https://beyondllm.aiplanet.com/
Apache License 2.0
263 stars 40 forks source link

Add files via upload #82

Closed adityasingh-0803 closed 3 weeks ago

adityasingh-0803 commented 3 weeks ago

Screenshot 2024-10-27 215721 Screenshot 2024-10-27 215711 Screenshot 2024-10-27 215652

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.

adityasingh-0803 commented 3 weeks ago

@tarun-aiplanet please check and verify

tarun-aiplanet commented 3 weeks ago

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.

tarun-aiplanet commented 3 weeks ago

I am closing this PR, as its irrelevant code addition.

adityasingh-0803 commented 3 weeks ago

can we do it without api support

adityasingh-0803 commented 3 weeks ago

like genrating text without api support