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, via Composer, 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 the high quality services now available. Inspired by what is possible with ProcessWire, I built Fluency, a third-party translation service integration for ProcessWire. 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. Module Features Translate any multilanguage field while editing any page. Translate fields in Repeater, Repeater Matrix, Table, Fieldset Page, Image descriptions, etc. Translate any file that added in the ProcessWire language pages. It's possible to translate the entire ProcessWire core in ~20 minutes Provide intuitive translation features that your clients and end-users can actually use. Fluency is designed for real-world use by individuals of all skill levels with little to no training. Its ease-of-use helps encourage users to adopt a multilanguage workflow. Start for free, use for free. Translation services supported by Fluency offer generous free tiers that can support regular usage levels. Fluency is, and will always be, free and open source. Use more than one Translation Engine. You may configure Fluency to use either DeepL, Google Cloud Translation, or both by switching between them as desired. AI powered translations that rival humans. DeepL provides the highest levels of accuracy in translation of any service available. Fluency has been used in many production sites around the world and in commercial applications where accuracy matters. Deliver impressive battle-tested translation features your clients can count on. Disable translation for individual fields. Disable translation for multilanguage fields where values aren't candidates for translation such as phone numbers or email addresses Configure translation caching. Caching can be enabled globally so that the same content translated more than once anywhere in ProcessWire doesn't count against your API usage and provides lightning fast responses. Set globally ignored words and text. Configure Fluency to add exclusionary indicators during translation so that specific words or phrases remain untranslated. This works either for specific strings alone, or present in other content while remaining grammatically correct in translation. Choose how translation is handled for fields. Configure Fluency to have buttons for either "Translate from {default language}" on each tab, or "Translate To All Languages" to populate every language for a field from any language to any language you have configured. No language limits. Configure as few or as many languages as you need. 2, 5, 10, 20 language website? Absolutely possible. If the translation service you choose offers a language, you can use it in ProcessWire. When new languages are introduced by third parties, they're ready to use in Fluency. Visually see what fields and language tabs have modified content. Fluency adds an visual indication to each field language tab to indicate which has different content than when opening the edit page. This helps ensure that content updated in one language should be updated in other languages to prevent content divergence between languages. Render language meta tags and ISO codes. Output alt language meta tags, add the current language's ISO code to your <html lang=""> attribute to your templates that are automatically generated from accurate data from the third party translation service. Build a standards-compliant multi-language SEO ready page in seconds with no additional configuration. Render language select elements. - Fluency can generate an unordered list of language links to switch between languages when viewing your pages. You can also embed a <select> element with JS baked in to switch between languages when viewing your pages. Render it without JS to use your own. Manage feature access for users. Fluency provides a permission that can be assigned to user roles for managing who can translate content. Track your translation account usage. View your current API usage, API account limit, and remaining allotment to keep an eye on and manage usage. (Currently only offered by DeepL) Use the global translation tool. Fluency provides translation on each field according to the languages you configure in ProcessWire. Use the global translation tool to translate any content to any language. Use Fluency from your templates and code. All translation features, usage statistics, cache control, and language data are accessible globally from the $fluency object. Perform any operation and get data for any language programmatically wherever you need it. Build custom AJAX powered admin translation features for yourself. Fluency provides a full RESTful API within the ProcessWire admin to allow developers to add new features for ProcessWire applications powered by the same API that Fluency uses. Robust plain-language documentation that helps you get up to speed fast. Fluency is extremely easy to use but also includes extensive documentation for all features both within the admin and for the Fluency programming API via the README.md document. The module code itself is also fully annotated for use with the ProDevTools API explorer. Is and will always be data safe. Adding, upgrading, or removing Fluency does not modify or remove your content. ProcessWire handles your data, Fluency sticks to translating. Full module localization. Translate Fluency itself to any language. All buttons, messages, and UI elements for Fluency will be presented in any language you choose for the ProcessWire admin. Built for expansion. Fluency provides translation services as modular "Translation Engines" with a full framework codebase to make adding new translation services easier and more reliable. Contributions for new translation services are welcome. Fluency is designed and built to provide everything you need to handle incredibly accurate translations and robust tools that make creating and managing multi-language sites a breeze. Built through research on translation plugins from around the web, it's the easiest and most friendly translation implementation for both end users and developers on any CMS/CMF anywhere. Fluency complements the built-in first class language features of ProcessWire. Fluency continues to be improved with great suggestions from the community and real-world use in production applications. Big thanks to everyone who has helped make Fluency better. Contributions, suggestions, and bug reports welcome! 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. 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. 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 You can install Fluency by adding the module to your ProcessWire project using any of the following methods. Method 1: Within ProcessWire using 'Add Module From Directory' and the class name Fluency Method 2: Via Composer with composer require firewire/fluency Method 3: Download from the Github repository and unzip the contents into /site/modules/ Feedback File issues and feature requests here (your feedback and testing is greatly appreciated): https://github.com/SkyLundy/Fluency/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...