--->This is a simple Streamlit application that uses the OpenAI API to generate a message based on your input. It utilizes the text-davinci-002 engine to create language learning related message for your input text.



--->We have to run these code on Google collab with cpu or on Tesla t4 gpu.



--->We can change our prompt according to our requirements by doing one changes in the code.
Features:

* Generate personalized love messages based on your input.
* Includes French language option to add a touch of romance.
* Easy-to-use interface for writing and customizing your message.
* Securely connects to OpenAI API using your personal API key.

Getting Started:

1. Install the required libraries:
   
   !pip install streamlit -q
   
   !pip install openai==0.28
   
   !wget -q -O - ipv4.icanhazip.com   ### after run this copy the address generated by streamlit.
   
   ! streamlit run app.py & npx localtunnel --port 8501  ### now click on the generated url by running this line after this paste the address on the input box and submit.
  
3. Set your OpenAI API key in the `GPT_Completion` function.
4. Run the Python file using your preferred command prompt.
5. Input your desired message in the provided text box.
6. Click the "Generate" button to see your AI-powered message.

Usage Example:

1. In the text box, type your message prompt.
2. (Optional) Choose the "French" option for a message.
3. Click the "enter" button.
4. The application will generate a message based on your prompt.

Customization:

You can customize the generated message by changing the `GPT_Completion` function parameters. These parameters include:

* **temperature:** Controls the randomness of the generated text.
* **top_p:** Controls how much weight is given to the most likely completions.
* **max_tokens:** Maximum number of tokens to generate.
* **frequency_penalty:** Penalizes the model for generating repetitive sequences.
* **presence_penalty:** Penalizes the model for generating sequences that are already present in the prompt.

Contributing:

This project is open-source and welcomes contributions! If you have any suggestions or improvements, feel free to fork the repository and send a pull request.

License:

This code is licensed under the MIT License. You are free to use, modify, and distribute it as long as you comply with the license terms.

{}
region:us