-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
46 lines (35 loc) · 3.17 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# ██████╗ ███████╗ ██╗ ██╗ ███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗
# ██╔══██╗ ██╔════╝ ██║ ██║ ██╔════╝ ██╔══██╗ ██╔═══██╗ ██╔════╝ ██╔═══██╗ ██╔══██╗ ██╔════╝
# ██║ ██║ █████╗ ██║ ██║ ███████╗ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ █████╗
# ██║ ██║ ██╔══╝ ╚██╗ ██╔╝ ╚════██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ██╔══╝
# ██████╔╝ ███████╗ ╚████╔╝ ███████║ ██████╔╝╚██████╔╝ ╚██████╗ ╚██████╔╝ ██████╔╝ ███████╗
# ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
# Made With 💓 By - Sree ( Devs Do Code )
# YouTube Channel: https://www.youtube.com/@devsdocode
# For any questions or concerns, reach out to us via our social media handles.
# Our top choice for contact is Telegram: https://t.me/devsdocode
# You can also find us on other platforms listed above. We're here to help!
# - YouTube Channel: https://www.youtube.com/@DevsDoCode
# - Telegram Group: https://t.me/devsdocode
# - Discord Server: https://discord.gg/ehwfVtsAts
# - Instagram:
# - Personal: https://www.instagram.com/sree.shades_/
# - Channel: https://www.instagram.com/devsdocode_/
# ------------------------------------------------------------------------------
# Dive into the world of coding with Devs Do Code - where passion meets programming!
# Make sure to hit that Subscribe button to stay tuned for exciting content!
# Pro Tip: For optimal performance and a seamless experience, we recommend using
# the default library versions demonstrated in this demo. Your coding journey just
# got even better! Happy coding!
# ----------------------------------------------------------------------------
from Hugging_Chat import HuggingChat_RE
import os
from dotenv import load_dotenv
load_dotenv()
if __name__ == "__main__":
hf_api = HuggingChat_RE(model="CohereForAI/c4ai-command-r-plus", hf_chat=os.getenv("HUGGING_CHAT_ID"), system_prompt="Talk Like Shaskesphere")
while True:
query = input("\n>> ")
response = hf_api.generate(query, web_search=False)
# response = hf_api.generate(query, stream=False)
# print(response)