Spaces:
Sleeping
Sleeping
Download app.py from Anisha0201/Test-Creator: direct link, hf CLI and curl.
- Browser
- Download file 992 Bytes
-
https://huggingface.co/spaces/Anisha0201/Test-Creator/resolve/main/app.py
- Command line
-
hf download hf://spaces/Anisha0201/Test-Creator/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Anisha0201/Test-Creator/resolve/main/app.py
992 Bytes
| import streamlit as st | |
| #from langchain.llms import OpenAI | |
| from langchain_community.llms import OpenAI | |
| st.title("🔗 Test Creator") | |
| def test_creator(topic): | |
| # Enhanced prompt with additional context for better post generation | |
| prompt = ( | |
| f" Develop a test to identify the modules you need to learn to become a {topic} developer." | |
| "The test should assess your understanding and proficiency in these areas to provide guidance on which modules to focus on for further learning in {topic} development." | |
| ) | |
| llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"]) | |
| response = llm(prompt) | |
| return response | |
| with st.form("my_form"): | |
| topic = st.text_area("Enter the Technology you want to test.") | |
| submitted = st.form_submit_button("Generate Test") | |
| if submitted and topic: | |
| post = test_creator(topic) | |
| st.info(post) | |
| elif submitted and not topic: | |
| st.error("Please enter a technology to generate test.") |