Hugging Face AI Agents Course

AI Agents sind DAS Thema derzeit. Regelmäßig gute Links dazu bietet übrigens George Siemens „SAIL“-Newsletter https://buttondown.com/SAIL/archive
So bin ich auch auf den am 10.2.2025 gestarteten kostenlosen „AI Agents“-Kurs von Hugging Face gestoßen:
https://huggingface.co/agents-course
https://huggingface.co/learn/agents-course/unit0/introduction

Die Hugging Face Empfehlung für Teilnehmende ohne Python-Kenntnisse lautet, sich (evtl. nur) mit Unit1 „Introduction to Agents“ zu befassen und ein kleines Zertifikat zu erwerben. Am Ende des Unit1-Theorieteils gibt es die Möglichkeit, ein fertiges AI-Agent-Beispiel online in einem eigenen Hugging Face Space auszuprobieren und dabei lediglich in einer Python-Datei kleinere Anpassungen zu machen. Verwendet wurde dafür „Smolagents“, das AI Agent Framework von Hugging Face.

HF AI Agents Course Certificate ID (Unit1)

Meine Tests mit dem in Unit1 angebotenen AI-Agent-Beispiel
Wegen Überlastung des eingebundenen Qwen2.5-Coder-32B-Instruct-LLM habe ich schnell auf die im Skript aktivierbare technische Alternative zurückgreifen müssen. Dann klappte es gut mit Anfragen und Ergebnissen mit Darlegung der Agent-„Thoughts“ bis hin zur „Final Answer“.
Bzgl. eigenen Anpassungen der Python-Beispieldatei habe ich 2 Dinge getestet:
a) Aktivieren des bereits vorbereiteten Image-Generators durch Eintrag in der Zeile tools=[final_answer, image_generation_tool],
b) Eintragen eines kleinen Lottozahlen-Skripts als Tool
Wieder einmal war die Nutzung von ChatGPT hilfreich, um mir ggf. Code erklären bzw. generieren zu lassen, da meine Python-Kenntnisse sich in Grenzen halten 🙂

Für mich interessant: Der bereits im AI-Agent-Beispiel referenzierte Image-Generator greift auf „model_sdxl = „black-forest-labs/FLUX.1-schnell“ zurück und lieferte ziemlich gute Bilder.

Chatverlauf Screenshot 1 | Chatverlauf Screenshot 2 | Chatverlauf Screenshot 3

Ergebnisbild 1 | Ergebnisbild 2 | Ergebnisbild 3|

 

***************************

Abschließend noch eine Erklärung aus dem Kurs, was ein AI Agent ist 🙂

„To summarize, an Agent is a system that uses an AI Model (typically an LLM) as its core reasoning engine, to:

Understand natural language: Interpret and respond to human instructions in a meaningful way.

Reason and plan: Analyze information, make decisions, and devise strategies to solve problems.

Interact with its environment: Gather information, take actions, and observe the results of those actions.“

(Quelle: https://huggingface.co/learn/agents-course/unit1/what-are-agents)

 

Bilder generieren mit ideogram.ai

Auf der Suche nach einer Alternative zu DALLE-3 stieß ich auf ideogram.ai – auch aufgrund des Hinweises, dass ideogram.ai sehr gut mit Texten in Bildern umgehen kann. Das Web-Tool hat mir sowohl von der Qualität als auch von der Geschwindigkeit her sehr gut gefallen. Wie inzwischen so ziemlich alle Tools, erfordert es ein persönliches Login (Google, Apple) – auch für einen freien Account mit max. 25 Prompts täglich. Hier die ideogram.ai-Dokumenation: https://docs.ideogram.ai/using-ideogram/generating-images und die Nutzungsbedingungen: https://ideogram.ai/tos

ideogram.ai-Testbericht

Programm-Oberflaeche

Mit jedem Prompt werden 4 Bilder erzeugt, von denen eines automatisch zum Cover-Bild gewählt wird. Dennoch kann man manuell einzelne Bilder aus verschiedenen Kollektionen anpinnen an den eigenen Account (s.u. Screenshot). Die erzeugten Bilder sind downloadbar im jpg-Format inkl. Exif-Daten. Die Option „share“ scheint im ideogram.ai-Bereich intern zu bleiben, daher hier im Blogbeitrag manuell hochgeladene Ergebnisse.

Standardmäßig ist „Magic Prompt“ angehakt zur Optimierung der eigenen Text-Eingabe, was man auf Wunsch aber deaktivieren kann. Ansonsten kann man noch zwischen verschiedenen Ausgabe-Formaten wählen und das ist es dann schon mit der Wahlfreiheit bei einem kostenlosen Account: Erzeugte Bilder sind „public“ und man kann sie nicht löschen. Der Editor steht auch nur für Bezahl-Accounts zur Verfügung.

Screenshot meiner angepinnten ideogram.ai-Ergebnisse

Programm-Oberflaeche(zum Vergrößern anklicken)

Einzelbilder zum genaueren Anschauen


Prompt = 3 raccoons, a cat and a waterfall. wildlife photography


Prompt = a blue heron standing on a desk in front of a keyboard and looking at a monitor. mysterious yellow light, black and white items. a small pink raccoon logo in the upper right corner.


Prompt = Create an aspect ratio of 9:16 depicting half of a face of a raccoon and the other half with text „RACCOONS IN KASSEL FOREVER“ with bold and grunge effect on the text, black and white illustration with pink background, typography.

Magic Prompt = A striking black and white illustration with a 9:16 aspect ratio, capturing half of a raccoon’s face looking intently towards the viewer. The other half of its face is replaced by bold, grungy text that reads „RACCOONS IN KASSEL FOREVER“ in a playful and rebellious tone. The illustration is set against a vibrant pink background, adding an unexpected pop of color. The overall design is edgy and artistic, with a strong typography element that adds to its visual impact.
-> Mein Prompt war inspiriert von einem Beispiel auf X (Ex-Twitter): https://twitter.com/ideogram_ai/status/1775512625851375812
Meine Formatangaben wurden durch die gesetzte Option Aspect Ratio = 1:1 übersteuert.


Prompt = Stelle den Vorgang der Photosynthese symbolisch dar.

Magic Prompt = A creative visual representation of photosynthesis, where a large tree stands tall in a sunlit meadow. The tree’s leaves are depicted as glowing, capturing sunlight and converting it into energy. A series of tiny, colorful insects and birds surround the tree, symbolizing the interconnectedness of the ecosystem. In the background, there is a golden sun and a gentle, blue sky. The overall ambiance of the image is serene, with a touch of magic and life.


Prompt = cute young woman sitting on a beach reading a book labeled „Raccoons forever“, photo realistic style, mysterious sun light, typography.

-> Der Text im Bild klappte auf Anhieb, der Text auf dem Buchtitel nicht ganz so gut …


Prompt = a learning space designed with areas for quiet study, online learning, hybrid learning, power generation via exercise bikes and a comfortable relaxing atmosphere. empty – no students.

Magic Prompt = A futuristic and innovative learning space, designed for a variety of educational experiences. In the center, there are several exercise bikes connected to power generators, providing an eco-friendly way to produce energy while students study. The quiet study area features modern, comfortable seating and natural lighting, while the online and hybrid learning zones are equipped with state-of-the-art technology and interactive displays. The entire space is empty, awaiting the arrival of eager students to explore and learn in this unique environment.
-> Meine Eingabe „no students“ wurde leider ignoriert und auch die entsprechende automatisch erzeugte Eingabe des Magic Prompts … Die Darstellung der Personen ist zudem extrem schlecht – im Gegensatz zu meinem Beispiel mit dem Chemiker.


Prompt = a typical north german landscape. one blue sheep. sunny day.

Magic Prompt = A serene, sunny scene of a typical north German landscape, featuring a lush green field with various types of tall grass and wildflowers. In the center, a single, unique blue sheep grazes peacefully, contrasting with the surrounding natural colors. The sky is a brilliant blue, with fluffy white clouds floating above. The overall atmosphere is tranquil and idyllic, capturing the essence of a perfect rural day.


Prompt = Historisches Wasserschloss im Abendlicht. Bleistiftzeichnung.


Prompt = Louvre pyramid with giraffes next to it. Evening light. Photo.

Magic Prompt = A stunning photograph of the Louvre Pyramid bathed in the golden glow of evening light. Two elegant giraffes gracefully pose next to the pyramid, casting elongated shadows on the polished floor. The background reveals a serene, open plaza with a few people admiring the striking scene. The combination of modern architecture and graceful wildlife creates a harmonious and enchanting atmosphere.


Prompt = raccoon with balloon., graffiti


Prompt = Laborraum. Ein Chemiker mit einem Reagenzglas auf dem Tisch. Fotorealistisch.


Prompt = raccon for president. poster. typography

Magic Prompt = A vibrant and humorous political poster featuring a raccoon wearing a stylish suit, holding a microphone with the slogan „Raccoon for President.“ The raccoon’s face is replaced with the American flag, emphasizing its patriotic message. The background is a cityscape with skyscrapers, and the typography is bold, modern, and eye-catching. The overall tone of the image is playful and satirical, poking fun at the political landscape.


Prompt = a classroom. van Gogh style.


Prompt = a raccoon, a giraffe and a cat looking at the sunset over a river. black & white coloring book style illustration.


Prompt = self portrait of a emperor penguin as an artist, painting on a canvas in a historical setting that echoes the ambience of a 17th century Europe.


Prompt = 3 raccoons, a cat and a waterfall. wildlife photography

Magic Prompt = A serene wildlife photo capturing three raccoons and a cat coexisting peacefully near a picturesque waterfall. The raccoons display a mix of curiosity and caution, while the sleek cat observes intently from a distance. The waterfall cascades in the background, casting a mist that shines in the sunlight. The lush greenery and rocks in the foreground give a sense of the animals‘ natural habitat.


Prompt = Bergpark Kassel, Tiger, Katze und Maus., 3d render

Magic Prompt = A stunning 3D rendered scene of Bergpark Kassel, a majestic mountain park featuring a gigantic tiger, a curious cat, and a playful mouse. The tiger stands proudly on a hill, surveying the expansive park, while the cat and mouse engage in a lighthearted game nearby. The setting is a lush, green environment with vibrant flowers and trees, creating a serene atmosphere., 3d render
-> Der „Bergpark Kassel“ war dem Tool offensichtlich kein Begriff … (im Gegensatz zum Begriff „Louvre“)


Prompt = Louvre pyramid with giraffes next to it. Evening light. Photo.

Magic Prompt = A stunning photograph of the Louvre Pyramid illuminated by the warm evening light, with a delicately blurred effect. Near the base of the pyramid, two majestic giraffes gracefully pose, their long necks reaching towards the sky. The background reveals a picturesque view of the Louvre Museum and a serene cityscape. The overall atmosphere of the image is peaceful and enchanting, blending architecture, wildlife, and urban elegance.

Stable Diffusion locally on MacBook Air via App „Draw Things“

It would be nice to have a local installation of the open source text-to-image model Stable Diffusion… that was my idea this weekend. As I didn’t find any convincing installation manuals and even wasn’t sure if my Windows PC’s hardware would be sufficient, a very simple article about „Draw Things“ came to my attention: https://www.unidigital.news/draw-things-ki-bilder-kostenlos-unterwegs-generieren/ Unfortunately my iPad and my iPhone are too old, but with my MacBook Air (M1,2020) the installation was no problem:
Downloading the app „Draw Things“ from the Apple Store and afterwards downloading the proposed model „SDXL Refiner v1.0 (8-bit)“. My first text prompt with default options, 1024×1024 etc. and waiting time of some minutes, was a disaster, my second prompt was a disaster and so it went… double things and not nearly what I wanted. O.k., I’m a little bit spoiled because of mostly using ChatGPTPlus and Bing Image Creator, but what was that thing? Totally disappointed, I deleted all the results.

Here is one disturbing example from today „young woman holding an umbrella“:

image with model SDXL Refiner v.10 8-bit
(click to enlarge)

Today, I thought maybe I should be modest and download/install an older Stable Diffusion model in my „Draw Things“ app and therefore chose „Generic (Stable Diffusion v2.1)“ which would result in a lower resolution image 512×512. For my prompt I chose something about cats (because, normally „cats always work“) and finally, I got results resembling a cat:

image with model Generic, Stable Diffusion v2.1image with model Generic, Stable Diffusion v2.1image with model Generic, Stable Diffusion v2.1image with model Generic, Stable Diffusion v2.1
(click to enlarge)

The good results with the older model led me to the assumption, that the SDXL model was the problem and I googled… a YouTube video „Fix Double-Headed Glitches in Stable Diffusion with Kohya Hires Fix!“ helped me understand the problem (Link: https://youtu.be/SbgMwHDXthU?feature=shared). As I don’t have a local installation but the Apple Store App „Draw Things“, I can’t install any extensions, but I looked instead at the menu „Advanced“ in my „Draw Things“: There is indeed already a solution, that means a configuration option named „High resolution fix“ (description „[…] it avoids duplicate objects when generating directly“), which I simply had to enable in order to avoid double heads in my results.

First result after enabling „High Resolution Fix“:

image with model SDXL Refiner v.10 8-bit
(click to enlarge)

That’s the problem with news articles regarding the topic IT or AI: they become obsolete faster than you can think – I don’t mean any offense – and next time, I will go through the advanced options even when I don’t want to experiment deeper with a software.

At last, I can start generating images with my local installation of Stable Diffusion via App „Draw Things“:

Draw Things Screenshot
(click to enlarge)

Thanks to the developer of „Draw Things: AI Generation“!

Bookmarks zu AI & Education

Diesen Blogbeitrag möchte ich nutzen, um einige Links aufzulisten, die ich sehr interessant finde.

VERANSTALTUNGEN ZU CHATGPT

  • … gab und gibt es wie Sand am Meer. An der RPTU waren wir am 20.12.22 früh dabei mit der Einladung zu einem Vortrag von Prof. Weßels unter dem Titel „ChatGPT in der modernen Lehre“. Hier der Link zur YouTube-Aufzeichnung:
    https://youtu.be/_QaVNFuH6Cw

NEWS UND PUBLIKATIONEN ZU KI

KI-TOOLS

OpenSource KI-Chatbot HuggingChat

HuggingChat
Q: https://huggingface.co/chat/

Gestern las ich bei Heise (Link) einen Artikel über den neuen OpenSource-Chatbot namens „HuggingChat“. Das klang spannend und musste bald ausprobiert werden. Die Chatbots sind schnell und so konnte ich heute früh, während ich in der Telefon-Warteschleife beim VRN hing, um nach dem Stand meines „Deutschlandlandtickets Job“ nachzufragen, am PC bei HuggingChat meine Fragen platzieren, die ich im Dezember 20222 schon ChatGPT gestellt hatte. Das manuelle Verfassen des folgenden Blogartikels dauerte dann natürlich deutlich länger.

Zugang: https://huggingface.co/chat/ ohne Registrierung
Hinweis: „This application is for demonstration purposes only“, Version „v0“ April 2023
Current Model: „For now, it’s running OpenAssistant’s latest LLaMA based model“: OpenAssistant/oasst-sft-6-llama-30b

 

Bsp. 1 Why should I go to a lecture at a university if I am a student? (Link zum Screenshot)

Bsp. 2 What is your recommendation for an interactive live seminar with some students at university and some students at home? (Link zum Screenshot)

Bsp. 3 How should a learning management course look like in order to be motivating for students? (Link zum Screenshot)

Bsp. 4 Generate an easy multiple choice question relating to the topic sports and AI with 4 wrong answers and 1 correct answer. (Link zum Screenshot)

Bsp. 5 Which 5 aspects do I need to know about RPTU? (Link zum Screenshot 1 / Link zum Screenshot 2)

Bsp. 6 Write a poem about a racoon who wants to move to Heidelberg, but doesn’t find an appartment. (Link zum Screenshot)

Mein kurzes Fazit:

  • „HuggingChat“ ist schon ziemlich gut, wenngleich ChatGPT „besser“ war. Wie auch bei ChatGPT sind die gegebenen Antworten nicht immer inhaltlich korrekt.
  • Mit „HuggingChat“ hatte ich deutlich mehr Missverständnisse bzgl. meiner Prompt-Formulierungen, die ich im Dezember 2022 allerdings auch nicht unbedingt perfekt überlegt hatte. (Bsp. 4 und 5)
    Vom Hinweis auf „refrain from asking me sensitive personal information“ bis hin zu inhaltlich komplett an der Sache vorbei.
  • Interessant ist auch die Art der Rückfragen und wann sie vom Chatbot gestellt wurden und wann nicht. Bei Fragen mit einer Abkürzung wie im Bsp. 5 fände ich eine Rückfrage elementar, da es eigentlich immer mehrere Möglichkeiten gibt, was gemeint ist.
    RPTU ohne Rückfrage als „reptile parenting techniques unleashed“-Website zu interpretieren, ist schon sehr schräg, zumal es so ein Portal wohl gar nicht gibt 😉
  • Bei HuggingChat scheint es eine Maximallänge der Antworten zu geben, bei der Chatbot-Antworten einfach mitten im Wort abbrechen, was sehr irritierend ist. (Bsp. 1, 3, 5)

Ganz klar im Vorteil ist, wer seine Prompts gut formuliert, auch aufgrund Hintergrundwissens über die zugrunde liegenden Modelle. Diese Erfahrung habe ich auch vor allem bei KI-Bildgeneratoren gemacht. Ob „Prompt Engineer“ ein neues gut bezahltes Berufsfeld wird oder nicht, wird sich zeigen. Die Suche und Bewertung von Informationen ist ja eine Kernaufgabe von Bibliothekaren – ich erinnere mich noch an mein Studium in Hamburg, wo wir Mitte der 80er die Formulierung von GRIPS/DIRS-Anfragen in kostenpflichtigen Datenbanken gelernt haben… (= General Relation based Information Processing System/DIMDI’S Information Retrieval System)