Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/22/2023 in all areas

  1. I am finetuning existing pre-trained models and using langchain toolchain. (About the later, I suggest you to try and keep an eye on a fork of PrivateGPT which is @su77ungr/CASALIOY). I like to be able to run it without the need to plug Internet wire, which is the most important requirement, and I also got really good results with CASALIOY after ingesting a small part of the company's knowledge base. I made some years ago a license plate recognition system deployed on our parks and I am able to ask a basic question in the context of our proprietary softwares and get a response like "Blabla you need to send this MSG_LPR_.. Windows Message with this LParam and WParam, the block will answer you the current amount due by the client in a JSON string stored in WParam... ". It can also explain what a settings do along with real example context, eg., "If the setting `blabla` is set to true, when a car approach, if it's a VIP or is annual fixed bill is paid, the barrier is opened...". It's really astonishing. I am using Vicuna-13b, not GPT, you can find more infos there: lmsys.org Last week I experimented a model called YOLOv7, which is an algorithm for detecting objects in an image. The challenge for us (I got it almost working) is to detect vehicle type in real-time to apply our logic, example, detecting taxis, ambulance, truck and opening the barrier. Look at that : Above, the AI is triggered in real-time on the picture sent by an IP camera already used in our LPR system. You might want to read this paper: https://arxiv.org/pdf/2212.10560.pdf You will find example of how to implement it on Github. After the release of my ongoing project, I had in mind to try to launch a project if Ryan and the mods team consent to, which consist of scrapping the entire forum and build a chat bot, I find it funny to build it, and I would like to see how good will be answer to issues like the ones that recently popped again, yo know, the "the forged session thing", "backend login crash expiration", etc, more than focusing on the core base code of the tool. We might collaborate to learn together 🙂 Just adding that the main issue, is the hardware power...
    6 points
  2. Thanks! I found out you can change the label text for the page reference field in the field settings itself.
    2 points
  3. Just hook into the page list label 🙂 https://processwire.com/talk/topic/26610-custom-page-list-label/?do=findComment&comment=220584
    2 points
  4. @netcarver I've been using Latte in Laravel almost exclusively. Blade is great, but Latte is even better. There's a composer package for integrating Latte, but it was out of date when I last checked so I wrote my own which was quite straightforward. Interestingly, you can mix and match, calling Blade views from Latte and vice versa, which is a lifesaver when dealing with vendor files and third-party packages.
    2 points
  5. That prompt is pretty amazing. I gave it the task: It did a quite good job without me having to iterate manually over the results (not tested): <?php class ErrorInterceptor extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Error Interceptor', 'version' => 1, 'summary' => 'Intercepts all warnings, errors, exceptions, and fatal errors, adds a backtrace, unifies the message, and logs it using the ProcessWire log API.', 'autoload' => true, 'singular' => true, ); } public function init() { set_error_handler(array($this, 'errorHandler')); set_exception_handler(array($this, 'exceptionHandler')); register_shutdown_function(array($this, 'shutdownFunction')); } public function errorHandler($errno, $errstr, $errfile, $errline) { $backtrace = debug_backtrace(); $unifiedMessage = $this->unifyMessage('Error', $errno, $errstr, $errfile, $errline, $backtrace); $this->logError($unifiedMessage); } public function exceptionHandler($exception) { $errno = $exception->getCode(); $errstr = $exception->getMessage(); $errfile = $exception->getFile(); $errline = $exception->getLine(); $backtrace = $exception->getTrace(); $unifiedMessage = $this->unifyMessage('Exception', $errno, $errstr, $errfile, $errline, $backtrace); $this->logError($unifiedMessage); } public function shutdownFunction() { $error = error_get_last(); if ($error !== null) { $errno = $error['type']; $errstr = $error['message']; $errfile = $error['file']; $errline = $error['line']; $backtrace = debug_backtrace(); $unifiedMessage = $this->unifyMessage('Fatal Error', $errno, $errstr, $errfile, $errline, $backtrace); $this->logError($unifiedMessage); } } private function unifyMessage($errorType, $errno, $errstr, $errfile, $errline, $backtrace) { $unifiedMessage = array( 'type' => $errorType, 'code' => $errno, 'message' => $errstr, 'file' => $errfile, 'line' => $errline, 'backtrace' => $backtrace ); return json_encode($unifiedMessage, JSON_PRETTY_PRINT); } private function logError($unifiedMessage) { $log = $this->wire('log'); $log->save('ErrorInterceptor', $unifiedMessage); } } Instead of using it on flowgpt.com, I put it in my locally hosted chatbot-ui. I installed it from https://github.com/jorge-menjivar/chatbot-ui which is a fork of the original https://github.com/mckaywrigley/chatbot-ui with some more features and bugfixes. I run it as a docker container locally. This ui is great because it lets you save and manage your prompts (and system prompts). It offers prompt variables, so I took that long prompt, added a variable where you are supposed to put in your project details and now I can use this prompt very conveniently. It also letz you export/import conversations, search the web etc. More info and some demos of the tool: twitter.com/chatbotui Interesting. Do you finetune existing models or use tools like langchain to create bots with custom context? I am experimenting with the latter and got some pretty good results so far. This is in the early stages but looks promising. I am building a vector db (chromadb) with embeddings for the complete core codebase of PW and then query that db to give context to a chatbot so it can answer coding questions on PW more specifically. ATM I only gave it the contents of the wire/core folder which is already 250MB in the vector db. The answers I'm getting out of it so far are quite good. The challenge here lies in optimizing the text splitter and creating the embeddings in a way targeting the LLM you are going to use for the chat. Ultimate goal is to have this running locally without proprietary LLMs like chatGPT. https://github.com/imartinez/privateGPT is a great project that can help with that. Open source models are getting better and better. So I hope in the not so distant future we can have our local coding assistants.
    2 points
  6. I think this is already quite impressive! I've updated the tool to support custom separators. This leads to an enormous number of possible combinations even if you only have 4 words in the dictionary, namely over 2 million!
    2 points
  7. Ok, thank you both 🙂 Here are my learnings: I went to the backend user profile to see if the password field has some helpful information I searched the core files for "characters long" wich was found in InputfieldPassword.module $minlength was a variable there, so I thought - as always - this would be configurable by PW I looked into Modules > Core > InputfieldPassword and found no configurable fields *surprise I found this thread and especially this answer by ryan: https://processwire.com/talk/topic/3149-password-complexity-requirements/?do=findComment&comment=31155 Luckily @adrian posted a link to the blog post that shows that everything is configurable now, I was just looking at the wrong spot: https://processwire.com/talk/topic/3149-password-complexity-requirements/?do=findComment&comment=158365 / blog post: https://processwire.com/blog/posts/upgrades-optimizations-pw-3.0.22/#major-enhancements-to-our-password-field Then I took a breath and thought about it as I somewhere read that forcing the user to use numbers might not be the best/most secure option and using a random string instead could be better in terms of UX and also security. Also when creating users in PW via the API the password requirements do not apply - so I can choose whatever syntax/requirements I wanted. So I created created an array of 100 random german words with the help of AI and then played around with that a little. This is the result: https://github.com/baumrock/PassPhraseJS I've also built an interactive calculator to see how many random passwords are possible with your chosen settings: https://baumrock.github.io/PassPhraseJS/example.html What do you guys think? Any suggestions for improvements? I'm already working on making the separators configurable so that will increase the number of possible passwords tremendously.
    2 points
  8. I don't know when I last found a tool for my daily work that had such a huge impact as Latte. The last one was ProcessWire I guess (which had an even greater impact of course, but still). Latte uses PHP syntax so you don't have to learn a new language! It plays extremely well with the PW API and it makes my markup files so much cleaner and easier to read and maintain I can't tell you. From time to time I stumble over situations where I'm once more impressed by latte, so this thread is intended to collect small latte snippets to show how one can use it. If you want use Latte for your ProcessWire projects you can either install it via composer or you wait some more days until I release RockFrontend - a frontend module that can render latte files and comes with several other nice frontend helpers ? ----- Breadcrumbs the Latte+PW way: <ul> <li n:foreach="$page->parents()->add($page) as $item"> <a href="{$item->url}" n:tag-if="$item->id != $page->id"> {$item->title} </a> </li> </ul> The cool thing here is that the last item (the page we are currently viewing) is NOT linked. The <a> tag is only rendered for all other items. Still the label of the link is rendered, because we are using n:tag-if and not n:if ----- Output an image, but only if it exists: <img n:if="{$page->yourimage}" src="{$page->yourimage->maxSize(400,300)->url}" alt="..."> Note that the ->maxSize() call will NOT throw an error even if you didn't upload an image! This is one of my favourite features of latte: Write the markup once and then add simple instructions directly within that tag. No more if/else/foreach chaos ?
    1 point
  9. Hello community! I want to share a new module I've been working on that I think could be a big boost for multi-language ProcessWire sites. Fluency is available in the ProcessWire Modules Directory and on Github Some background: I was looking for a way for our company website to be efficiently translated as working with human translators was pretty laborious and a lack of updating content created a divergence between languages. I, and several other devs here, have talked about translation integrations and have recognized the power that DeepL has. DeepL is an AI deep learning powered service that delivers translation quality beyond any automated service available. After access to the API was opened up to the US, I built Fluency, a third-party translation service integration for ProcessWire. Fluency brings automated translation to every multi-language field in the admin, and also provides a translation tool allowing the user to translate their text to any language without it being inside a template's field. With Fluency you can: Translate any plain textarea or text input Translate any TinyMCE or CKEditor (inline, or regular) Translate page names/URLs Translate in-template translation function wrapped strings Translate modules, both core and add-ons Installation and usage is completely plug and play. Whether you're building a new multi-language site, need to update a site to multi-language, or simply want to stop manually translating a site and make any language a one-click deal, it could not be easier to do it. Fluency works by having you match the languages configured in ProcessWire to those offered by the third party translation service you choose. Currently Fluency works with DeepL and Google Cloud Translation. Let's break out the screenshots... When the default language tab is shown, a message is displayed to let users know that translation is available. Clicking on each tab shows a link that says "Translate from English". Clicking it shows an animated overlay with the word "Translating..." cycling through each language and a light gradient shift. Have a CKEditor field? All good. Fluency will translate it and use DeepL's ability to translate text within HTML tags. CKEditor fields can be translated as easily and accurately as text/textarea fields. Repeaters and AJAX created fields also have translation enabled thanks to a JavaScript MutationObserver that searches for multi-language fields and adds translation as they're inserted into the DOM. If there's a multi-language field on the page, it will have translation added. Same goes for image description fields. Multi-language SEO friendly images are good to go. Creating a new page from one of your templates? Translate your title, and also translate your page name for native language URLs. (Not available for Russian, Chinese, or Japanese languages due to URL limitations). These can be changed in the "Settings" tab for any page as well so whether you're translating new pages or existing pages, you control the URLs everywhere. Language configuration pages are no different. Translate the names of your languages and search for both Site Translation Files (including all of your modules) Translate all of the static text in your templates as well. Notice that the placeholders are retained. DeepL is pretty good at recognizing and keeping non-translatable strings like that. If it is changed, it's easy to fix manually. Fluency adds a "Translate" item to the CMS header. When clicked this opens up a modal with a full translation tool that lets the user translate any language to any language. No need to leave the admin if you need to translate content from a secondary language back to the default ProcessWire language. There is also a button to get the current API usage statistics. DeepL account owners can set billing limitations via character count to control costs. This may help larger sites or sites being retrofitted keep an eye on their usage. Fluency can be used by users having roles given the fluency-translate permission. It couldn't be easier to add Fluency to your new or existing website. Simply add your API key and you're shown what languages are currently available for translation from/to as provided by DeepL. This list and all configuration options are taken live from the API so when DeepL releases new languages you can add them to your site without any work. No module updates, just an easy configuration. Just match the language you configured in ProcessWire to the DeepL language you want it to be associated with and you're done. Fluency also allows you to create a list of words/phrases that will not be translated which can prevent items such as brands and company names from being translated when they shouldn't Please note that the browser plugin for Grammarly conflicts with Fluency (as it does with many web applications). To address this issue it is recommended that you disable Grammarly when using Fluency, or open the admin to edit pages in a private window where Grammarly may not be loaded. This is a long-standing issue in the larger web development community and creating a workaround may not be possible. If you have insight as to how this may be solved please visit the Github page and file a bugfix ticket. Enhancements Translate All Fields On A Page Compatibility with newest rewrite of module is in progress... An exciting companion module has been written by @robert which extends the functionality of Fluency to translate all fields on a page at once. The module has several useful features that can make Fluency even more useful and can come in handy for translating existing content more quickly. I recommend reading his comments for details on how it works and input on best practices later in this thread. Get the module at the Github repo: https://github.com/robertweiss/ProcessTranslatePage Requirements: ProcessWire 3.0+ UIKit Admin Theme That's Fluency in a nutshell. A core effort in this module is to create it so that there is nothing DeepL related hard-coded in that would require updating it when DeepL offers new languages. I would like this to be a future-friendly module that doesn't require developer work to keep it up-to-date. The Module Is Free This is my first real module and I want to give it back to the community as thanks. This is the best CMS I've worked with (thank you Ryan & contributors) and a great community (thank you dear reader). DeepL Developer Accounts In addition to paid Pro Developer accounts, DeepL now offers no-cost free accounts. Now all ProcessWire developers and users can use Fluency at no cost. Learn more about free and paid accounts by visiting the DeepL website. Sign up for a Developer account, get an API key, and start using Fluency. Download & Feedback Download the latest version here https://github.com/SkyLundy/Fluency-Translation/archive/main.zip Github repository: https://github.com/SkyLundy/Fluency-Translation File issues and feature requests here (your feedback and testing is greatly appreciated): https://github.com/SkyLundy/Fluency-Translation/issues Thank you! ¡Gracias! Ich danke Ihnen! Merci! Obrigado! Grazie! Dank u wel! Dziękuję! Спасибо! ありがとうございます! 谢谢你!
    1 point
  10. Thanks for your reply! You're right that the number of matches is not necessarily an indicator for relevancy. As I stumbled over the quoted question I was just curious whether there was a selector or option that would allow me to quickly try it out because I have a project that could benefit from it. SearchEngine is a great module nonetheless. 🙂
    1 point
  11. Hi @snck! Although teppo might have a different answer, I suspect it'll be similar to this. The SearchEngine module simply makes it dead simple to add standard search functionality into ProcessWire without handling it all manually yourself (i.e.: properly parsing/escaping fields, extrapolating searchable text from files [with the SearchEngine FileIndexer add-on module], and figuring out how to generate a search result list). Beyond that, it still uses ProcessWire's own search functionality; it doesn't expand upon it. ProcessWire can do some pretty significant things in search, but overall it still relies on MySQL's fulltext search to handle everything. MySQL can offer some level of relevancy (depending on the PW selector search you choose), but it can't, as far as I know, order by number of matches found. Relevancy is not (necessasrily/typically) the same as number of matches (per matched database record). For anything outside of MySQL's default capabilities, something external would likely need to be integrated, such as Apache Lucene or ElasticSearch.
    1 point
  12. @bernhard Usually ProfilerPro would be great for this, but in some cases I can't use it because ProfilerPro is a module and I'm timing something that happens prior to modules loading. When PW is in debug mode, it times all of the boot processes, so I can just look at those. I also add other Debug::timer() calls as needed to time specific things. When testing in the admin, you can finish a timer with Debug::saveTimer($timer); and it'll show the result in the Debug > Timers section of the admin. But you can't look at any one instance of a timer. You've got to take several samples before you really know if there's a trend in the numbers. I'm usually looking for consistently 10 ms or more when it comes to improvements. @Ivan Gretsky The cache supports an expiration flag represented by the WireCache::expireReserved constant. It means that rows with that flag are reserved and should never be deleted. If you use the $cache API to clear the cache, it'll do it in a safe way. But if you just omit the caches table from a DB dump or manually delete all the rows in the caches table, then it would be problematic. I agree it would be better not to have to consider this. I'm not sure we need to keep that flag other than for modules, so this is one reason why I'm looking to have the modules use some other storage method for its cache. Though if new caching options came along (Redis, etc.) it would sure be nice for modules to be able to utilize that caching method too, so there are tradeoffs. Ideally, the modules would still use WireCache, but be able to recover easily if its caches get deleted, so that's probably what I'm going to work towards, but it's not as easy as it sounds. @teppo Sounds great! I have no experience with Redis but this server seems to have it and I've also been curious about it. I really like the idea of dedicated cache systems independent of the DB or file system. I'd definitely like for PW to be able to support them, and am glad to hear you are interested in it too.
    1 point
  13. True! 😅 I can't quantify right now how many GPU-hours it will require... we will know it when we will have an idea of the dataset size. I would go with Weaviate because it's open-source and self-manageable if needed; it's worth noting that both of them support hybrid search (sparse and dense vector concepts), . No idea which one is the most performant, but this details on our level seem not important. As a note, in the experiments I talked about in my previous post, I am using Qdrant as it have support for storing documents, and the most important part for me, again, you can self-manage it.
    1 point
  14. Thanks for the link, Bernhard, I've been trying blade in Laravel recently, but think I need to try out Latte as well.
    1 point
  15. @flydev wow, that is really impressive. I am far below your knowledge level atm. Thanks very much for sharing those links. Will certainly help me to brush up my knowledge. That idea about the forum chatbot is great. But that would be quite a lot of info to ingest. for large data sets like these, would you use pinecone or weaviate or other solutions?
    1 point
  16. Very interesting blog article that compares twig / blade / latte: https://blog.nette.org/en/quiz-can-you-defend-against-xss-vulnerability
    1 point
  17. I don't think that this is true 😉 Repeater items are just regular PW pages. They are hidden in the page tree somewhere under the admin page. It should then be possible to create a page reference field with a selector like "parent=123,include=all" Where 123 is the id of the page that holds your repeater items. Not sure if the include=all is necessary, just try it without.
    1 point
  18. Have you had a look at https://github.com/baumrock/PassPhraseJS ? You can simply include the js file and add 3 html attributes and you are done 🙂 Yeah I've had such a misconception in my head initially so I might have communicated that confusingly.
    1 point
  19. As you are on free plan, you are running on GPT 3.5 (fast) model trained. The goal is to trick GPT from the first prompt. For example, I suggest you to give a try to this awesome prompt which can transform ChatGPT into a high-quality programmer with a level 30 code proficiency on steroids 🦾😂 And then: 😼 $: programming: I have two words: foo and bar, I join those words with a dash. How many different strings can I get ? 🤖 $: There is only one way to join the words "foo" and "bar" with a dash, which is "foo-bar". Therefore, there is only one possible string that can be obtained by joining these two words in this specific way. Explore/experiment on flowgpt's prompts, I am sure you will get something amazing for us 🫡 guide link.
    1 point
  20. Hey @kongondo thx I'm already working on something and I'll keep you updated! 😎
    1 point
  21. @bernhard Have you searched for a dedicated library, e.g. on npm? I have seen a number of libraries in the past such as this one. There is also this conversation on SO.
    1 point
  22. Just wanted to say that this is indeed a very nice update! For an ongoing project I'm relying heavily on WireCache for caching due to the nature of the site: most users are logged in and there is a ton of traffic at very specific times. Keen to implement any performance enhancements, and Redis has been on the top of my list. Definitely interested in using (or developing, if need be) a Redis WireCache module. Sure, we have CacheRedis already, but a drop-in solution would be even better. (... not to mention that core support for drop-in caching modules is one instance where WP has been ahead of PW. Not that it matters all that much, but still happy to be able to tick that box 🙂)
    1 point
  23. Those are awesome news for us! We've had a long standing problem with moving ProcessWire installations from one server to another concerning the caches table. It would be great to completely decouple the modules cache from the user generated cache. Maybe move the modules cache to a separate db table. It seems intuitive (and most administrators seem to take this as granted) that you can simply purge the caches table to reduce the database dump size. But it is not like that ATM. Just had this problem yesterday with an experienced ops engineer, who doesn't have any PW experience... so your are magically right on time @ryan, as multiple times before!
    1 point
  24. Just noticed this one, published a few days ago: https://www.ionos.com/digitalguide/hosting/cms/processwire/ Cheers
    1 point
  25. Looks like a perfect application for LazyCron. A quick and dirty snippet of code you can place in site/ready.php (or inside a template's PHP file, just make sure that a page with that template is viewed regularly): <?php namespace ProcessWire; // Add daily hook to clean up incomplete, stale pages wire()->addHook('LazyCron::everyDay', null, function(HookEvent $event) { $ts = time() - 86400; // 24 hours ago // Find matching pages, adapt selector however you want (e.g. limit to certain templates or parents) $stalePages = $pages->find("created<$ts, title=''"); foreach($stalePages as $stalePage) { $pages->trash($stalePage); } });
    1 point
  26. Highly recommend Gumroad for selling this. It takes care of all sales tax nightmares and can automatically generate a license key per sale. Personally I wouldn't try adding license key checking into scriptable code (like PHP) as people who are going to cheat you are just going to edit the code to remove the check anyway, or just have it return true etc. Where the key can come in useful is for access to value-added features like support, so you ask "What's your license key" as part of the user's access to your support mechanism (forums/email etc)
    1 point
  27. That is a question I've been working on since the mid 90s. There is no simple solution when dealing with publicly viewable code. Generating a unique key is straightforward (eg, GUID, etc.). Validating the key requires a 'phone home' procedure, whether you do it on install or every time the code is executed is a choice to make. The problem lies with controlling the source code execution based on that validation. It is not possible to accomplish that with publicly viewable code.
    1 point
×
×
  • Create New...