Rospher commited on
Commit
b53e3ea
·
1 Parent(s): 1db4acb

Upload 4 files

Browse files
03 chatgpt chat assistant website.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import openai
3
+ import gradio
4
+
5
+ openai.api_key = "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"
6
+
7
+ messages = [{"role": "system", "content": "Yoa are a Professor of Computer Science department"}]
8
+
9
+ def CustomChatGPT(user_input):
10
+ messages.append({"role": "user", "content": user_input})
11
+ response = openai.ChatCompletion.create(
12
+ model = "gpt-3.5-turbo",
13
+ messages = messages
14
+ )
15
+ ChatGPT_reply = response["choices"][0]["message"]["content"]
16
+ messages.append({"role": "assistant", "content": ChatGPT_reply})
17
+ return ChatGPT_reply
18
+
19
+ demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Aman Verma's ChatBot")
20
+
21
+ demo.launch()
22
+
23
+
README.md CHANGED
@@ -1,13 +1,6 @@
1
  ---
2
- title: ChatBOT
3
- emoji: 🐠
4
- colorFrom: green
5
- colorTo: red
6
  sdk: gradio
7
- sdk_version: 3.38.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
  ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: Ama_ChatBot
3
+ app_file: 03 chatgpt chat assistant website.py
 
 
4
  sdk: gradio
5
+ sdk_version: 3.37.0
 
 
 
6
  ---
 
 
flagged/log.csv ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ user_input,output,flag,username,timestamp
2
+ how to learn java,"Learning Java can be a rewarding journey. Here are some steps you can follow to learn Java effectively:
3
+
4
+ 1. Set up your development environment: Install the Java Development Kit (JDK) on your computer. You can download the JDK from the official Oracle website (https://www.oracle.com/java/technologies/javase-jdk11-downloads.html). Choose the appropriate version for your operating system.
5
+
6
+ 2. Understand the basics: Familiarize yourself with the basic syntax, data types, variables, control structures, and object-oriented programming concepts in Java. Online tutorials, books, and video courses can provide a good starting point for learning these foundational concepts.
7
+
8
+ 3. Practice writing code: Java is a practical language, so practice coding by working on small projects and solving coding exercises. Websites like HackerRank, LeetCode, and CodingBat offer Java-specific coding challenges to help you practice your skills.
9
+
10
+ 4. Utilize online resources: There are numerous online resources available for learning Java. Some popular websites include Codecademy, Coursera, Udemy, and the official Oracle Java documentation. These resources offer structured courses, tutorials, and exercises to guide you through the learning process.
11
+
12
+ 5. Join a programming community: Engage with other Java learners and experienced developers in online forums or communities. By actively participating in discussions and asking questions, you can learn from others, gain insights, and receive feedback on your code.
13
+
14
+ 6. Read books and blogs: Supplement your learning by reading books and blogs focused on Java. Some recommended books for Java beginners include ""Head First Java"" by Kathy Sierra and Bert Bates and ""Effective Java"" by Joshua Bloch. Blogs like Baeldung and JavaWorld also provide valuable Java-related content.
15
+
16
+ 7. Build real-world projects: Once you have a good grasp of the fundamentals, challenge yourself by working on real-world projects. This will help you apply your knowledge and gain practical experience, which is crucial for becoming a confident Java developer.
17
+
18
+ 8. Practice debugging: Debugging is a key skill in software development. Practice identifying and fixing errors in your Java code to enhance your problem-solving abilities.
19
+
20
+ 9. Stay updated: Java evolves regularly with new releases and features. Stay updated with the latest news and developments in the Java community by following blogs, forums, and social media accounts related to Java.
21
+
22
+ 10. Never stop learning: Java is a vast language with a broad ecosystem. Continuously explore new libraries, frameworks, and design patterns to expand your Java skills.
23
+
24
+ Remember, learning Java requires patience and persistence. Be consistent with your learning, practice regularly, and seek help when needed. Don't hesitate to explore advanced topics once you have a strong foundation in the basics. Enjoy the learning process and have fun experimenting with Java!",,,2023-07-20 20:58:45.014597
25
+ how to learn java,"Learning Java can be a rewarding journey. Here are some steps you can follow to learn Java effectively:
26
+
27
+ 1. Set up your development environment: Install the Java Development Kit (JDK) on your computer. You can download the JDK from the official Oracle website (https://www.oracle.com/java/technologies/javase-jdk11-downloads.html). Choose the appropriate version for your operating system.
28
+
29
+ 2. Understand the basics: Familiarize yourself with the basic syntax, data types, variables, control structures, and object-oriented programming concepts in Java. Online tutorials, books, and video courses can provide a good starting point for learning these foundational concepts.
30
+
31
+ 3. Practice writing code: Java is a practical language, so practice coding by working on small projects and solving coding exercises. Websites like HackerRank, LeetCode, and CodingBat offer Java-specific coding challenges to help you practice your skills.
32
+
33
+ 4. Utilize online resources: There are numerous online resources available for learning Java. Some popular websites include Codecademy, Coursera, Udemy, and the official Oracle Java documentation. These resources offer structured courses, tutorials, and exercises to guide you through the learning process.
34
+
35
+ 5. Join a programming community: Engage with other Java learners and experienced developers in online forums or communities. By actively participating in discussions and asking questions, you can learn from others, gain insights, and receive feedback on your code.
36
+
37
+ 6. Read books and blogs: Supplement your learning by reading books and blogs focused on Java. Some recommended books for Java beginners include ""Head First Java"" by Kathy Sierra and Bert Bates and ""Effective Java"" by Joshua Bloch. Blogs like Baeldung and JavaWorld also provide valuable Java-related content.
38
+
39
+ 7. Build real-world projects: Once you have a good grasp of the fundamentals, challenge yourself by working on real-world projects. This will help you apply your knowledge and gain practical experience, which is crucial for becoming a confident Java developer.
40
+
41
+ 8. Practice debugging: Debugging is a key skill in software development. Practice identifying and fixing errors in your Java code to enhance your problem-solving abilities.
42
+
43
+ 9. Stay updated: Java evolves regularly with new releases and features. Stay updated with the latest news and developments in the Java community by following blogs, forums, and social media accounts related to Java.
44
+
45
+ 10. Never stop learning: Java is a vast language with a broad ecosystem. Continuously explore new libraries, frameworks, and design patterns to expand your Java skills.
46
+
47
+ Remember, learning Java requires patience and persistence. Be consistent with your learning, practice regularly, and seek help when needed. Don't hesitate to explore advanced topics once you have a strong foundation in the basics. Enjoy the learning process and have fun experimenting with Java!",,,2023-07-20 20:58:54.720555
requirements.txt CHANGED
@@ -1 +1 @@
1
- openai
 
1
+ openai