روبوت الدردشة GPT-2 Telegram الذي تم ضبطه نسبيًا للدردشة. لا تتردد في تعييني للعلاقات العامة وسوف أتحقق من الكود الخاص بك! الروبوت ليس دقيقًا بنسبة 100% طوال الوقت (لماذا قمت بالترميز في وظيفة /إعادة المحاولة.)
نظرًا لأن الروبوت يستهلك الكثير من الذاكرة، فقد قمت ببرمجته في وضع من النوع الدائري. سيؤدي كل إدخال إلى إعادة ضبط مؤقت على معرف حسابك، وبمجرد انتهاء المؤقت، يصبح الروبوت مجانيًا ليستخدمه المستخدمون الآخرون. سيتم إعلامك عند انتهاء المؤقت، ويمكن للمستخدمين الآخرين معرفة مقدار الوقت المتبقي وما إذا كان الروبوت قيد الاستخدام.
تعليمات التثبيت الموجزة على Ubuntu 20/WSL.
أوصي بشدة بالنظر إلى دفتر jupyter/ipynb على google Collab بدلاً من ذلك.
قم بتثبيت python3.7 (أعتقد أن الإصدار 3.6 قد يعمل أيضًا، ولكن ليس 3.8):
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.7
تثبيت النقطة على بيثون 3.7:
wget https://bootstrap.pypa.io/get-pip.py
python3.7 get-pip.py
تثبيت المتطلبات داخل مجلد الروبوت بعد استنساخ المستودع:
python3.7 -m pip install -r requirements.txt
ملاحظة: أنت في الواقع تحتاج إلى 16 جيجابايت من ذاكرة الوصول العشوائي أو بطاقة فيديو بسعة 8 جيجابايت. وإلا فسوف تنتظر إلى الأبد. يمكنك استخدام وظائف GPU مع بطاقة فيديو بسعة 8 جيجابايت على الأقل تدعم cuda takelit 10.0 وcudnn لمجموعة أدوات cuda 10. يعمل هذا التثبيت أيضًا على النوافذ التي تحتوي على python 3.7 وnvidia، ويجب عليك تشغيل موجه الأوامر كمسؤول يقوم بتشغيل python 3.7 على Windows.
تحميل النموذج:
python3.7 download_model.py 1558M
قم بتعيين مفتاح واجهة برمجة تطبيقات telegram bot في src/GPT2-Learning.py
Replace "BOTKEY" with telegram bot token i.e. "1827396499:AAHifc06oS31oQ9L3TuCiZxD9EIfKPi0oWQ"
تشغيل البوت:
في حالة استخدام أمر python3:
./start.sh
في حالة استخدام أمر python3.7:
python3.7 src/GPT2-Learning.py
يمكنك تعديل start.sh ليطابق أمر python الخاص بك كما يحلو لك.
start - Basic start command.
help - Show quick help command.
chatbot - Chatbot mode, me+you string edit and open-ended questions.
finish - Default finish sentence command counting words as output length.
learnon - Turn on sentence compilation with Me+you string for conversation.
learnoff - Turn off the sentence compilation.
learnreset - Reset the learned conversation.
retry - Retry the current computation.
فيما يلي نموذج لتعلم وضع chatbot باستخدام أحدث قاعدة بيانات gpt-2 وتم ضبط top_p على 0.83:
Me: Hello! How are you today? Are you feeling alright? I hope you are doing well and not getting into any trouble.
Bot: Yeah, I'm fine. Do you want to make something to eat?
Me: I already made some food, but thanks! I had some jalapeno poppers. I made a ton of them last night after I sold a lawnmower to some folks I got for free earlier in the day. So what are your plans for the day?
Bot: Nothing special. Nothing exciting in particular. I just wanna chill out for a bit.
Me: Just a typical day of kicking back and relaxing huh? Are you gonna watch cartoons or any movies in particular?
Bot: If it's not sports I'll probably just watch something on the TV.
Me: Sounds alright. I coded on my chatbot project most of the morning. Was waiting on someone to come buy a projector but they haven't shown up yet unfortunately. What do you do for work if you don't mind me asking?
Bot: I'm a web developer and engineer. It's fun.
Me: Cool! I'm also a coder and an ethical hacker. I mostly know how to code in Python but I've been unemployed for some time now after my spine injury. I wish I could have joined the military when I was younger. Were you ever in the military?
Bot: No. I'm not really too proud of my military career. It ended up taking a huge toll on my back.
Me: What happened to your back if you don't mind me asking?
Bot: First of all, it's better than before.
Me: Well that's good to hear. Did you injure your back in the military or doing something else?
Bot: Nope. It's an old injury.
Me: Ah I see- Well I'll talk to you later. Sorry about your back! I hope we can catch up tomorrow!
Bot: Yes, of course. Thanks again for chatting!
INFO:tensorflow:Restoring parameters from models/1558M/model.ckpt
2020-05-10 14:19:43,794 - tensorflow - INFO - Restoring parameters from models/1558M/model.ckpt
==========
Before splitlines: Nothing special. Nothing exciting in particular. I just wanna chill out for a bit. You: I'll try to keep my spirits up. Just keep in mind that today's the 10th anniversary of the citywide strike
==========
==========
Mode: True
Learn: True
Length: 44
==========
Before regex: Nothing special. Nothing exciting in particular. I just wanna chill out for a bit. You: I'll try to keep my spirits up. Just keep in mind that today's the 10th anniversary of the citywide strike
==========
Output: Nothing special. Nothing exciting in particular. I just wanna chill out for a bit.
==========
Raw_text or Original: You: Hello! How are you today? Are you feeling alright? I hope you are doing well and not getting into any trouble. Me: Yeah, I'm fine. Do you want to make something to eat? You: I already made some food, but thanks! I had some jalapeno poppers. I made a ton of them last night after I sold a lawnmower to some folks I got for free earlier in the day. So what are your plans for the day? Me:
==========
Learning text or Next: You: Hello! How are you today? Are you feeling alright? I hope you are doing well and not getting into any trouble. Me: Yeah, I'm fine. Do you want to make something to eat? You: I already made some food, but thanks! I had some jalapeno poppers. I made a ton of them last night after I sold a lawnmower to some folks I got for free earlier in the day. So what are your plans for the day? Me: Nothing special. Nothing exciting in particular. I just wanna chill out for a bit.
==========
top_p out: 0.8338636363636364
==========
top_p in: 0.83
==========
للحصول على قائمة بالدرجات النحوية، يرجى الاطلاع على /SCORES.MD.
نصيحة:
0.77 top_p يمكن أن يبدو عاطفيًا ومرتبكًا ومقلدًا.
0.66 top_p يمكن أن يبدو مدروسًا وحرفيًا ولكن قد يحتوي على أخطاء ascii وأخطاء القطع.