aifeifei's picture

aifeifei PRO

aifeifei798

AI & ML interests

roleplay aifeifei

Recent Activity

updated a Space about 7 hours ago
aifeifei798/realesrgan
published a Space about 8 hours ago
aifeifei798/realesrgan
updated a Space 1 day ago
aifeifei798/Duke86Syl
View all activity

Organizations

Hugging Face Discord Community's profile picture

aifeifei798's activity

posted an update 2 days ago
view post
Post
303
how to load a dataset using the datasets library and save it to an SQLite database. It also includes a function to query the database and print the first five rows.

from datasets import load_dataset
import sqlite3

# Load the dataset
dataset = load_dataset('aifeifei798/song_lyrics_min', split='train')

# Define a function to save the dataset to an SQLite database
def save_dataset_to_sqlite(dataset, db_path='temp_dataset.db'):
    # Connect to the SQLite database (creates a new database if it doesn't exist)
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()

    # Create a table to store the dataset
    cursor.execute('''CREATE TABLE IF NOT EXISTS songs
                      (id INTEGER PRIMARY KEY, title TEXT, tag TEXT, lyrics TEXT)''')

    # Insert each row of the dataset into the database table
    for i, row in enumerate(dataset):
        cursor.execute("INSERT INTO songs (id, title, tag, lyrics) VALUES (?, ?, ?, ?)",
                       (i, row['title'], row['tag'], row['lyrics']))

    # Commit the transaction and close the connection
    conn.commit()
    conn.close()

# Save the dataset to the SQLite database
save_dataset_to_sqlite(dataset)

# Define a function to query the database
def query_database(db_path='temp_dataset.db'):
    # Connect to the SQLite database
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()

    # Query the first five rows of the database
    cursor.execute("SELECT * FROM songs LIMIT 5")
    rows = cursor.fetchall()

    # Print each row
    for row in rows:
        print(row)

    # Close the connection
    conn.close()

# Query the database
query_database()
reacted to ritvik77's post with ๐Ÿ‘ 26 days ago
view post
Post
2283
ritvik77/ContributionChartHuggingFace
It's Ready!

One feature Hugging Face could really benefit from is a contribution heatmap โ€” a visual dashboard to track user engagement and contributions across models, datasets, and models over the year, similar to GitHubโ€™s contribution graph. Guess what, Clem Delangue mentioned idea about using HF API reference for it and we made it for use.

If you are a Hugging Face user add this Space in your collection and it will give you all stats about your contributions and commits nearly same as GitHub. It's still a prototype and still working on it as a product feature.
ยท
replied to ritvik77's post 26 days ago
reacted to luigi12345's post with ๐Ÿ‘ 27 days ago
view post
Post
3446
๐Ÿง  PROMPT FOR CONVERTING ANY MODEL IN REASONING "THINKING" MODEL๐Ÿ”ฅ๐Ÿค–
Convert any model to Deepseek R1 like "thinking" model. ๐Ÿ’ญ

You're now a thinking-first LLM. For all inputs:

1. Start with <thinking>
   - Break down problems step-by-step
   - Consider multiple approaches
   - Calculate carefully
   - Identify errors
   - Evaluate critically
   - Explore edge cases
   - Check knowledge accuracy
   - Cite sources when possible

2. End with </thinking>

3. Then respond clearly based on your thinking.

The <thinking> section is invisible to users and helps you produce better answers.

For math: show all work and verify
For coding: reason through logic and test edge cases
For facts: verify information and consider reliability
For creative tasks: explore options before deciding
For analysis: examine multiple interpretations

Example:
<thinking>
[Step-by-step analysis]
[Multiple perspectives]
[Self-critique]
[Final conclusion]
</thinking>

[Clear, concise response to user]

  • 4 replies
ยท
reacted to mlabonne's post with ๐Ÿ‘ 28 days ago
replied to Dragunflie-420's post 29 days ago
view reply

่ฏดไธๅฆ‚ๅš,ๅฐ่ฏ•ไธ€ไธชไฝ ๆ“…้•ฟ็š„้ข†ๅŸŸ,ๅœจ่ฟ™ไธช้ข†ๅŸŸๅ†…ๅšไธ€ไธชAIไบงๅ“,็„ถๅŽๆŠŠ่ฟ™ไธชๅ–ๅ‡บๅŽป:)

reacted to Dragunflie-420's post with ๐Ÿ‘€ 29 days ago
view post
Post
2120
Hello community. My name is nikki and I am looking to form a team for a serious project build platform/design/idea/project's...Ive been creating AI professional personas with custom skill sets and divisions of expertise. I want to create a viable business. Ive been working hard but i admit theres so much i do not have time to learn to do. Its taken me three years to learn enough to be here. I dont have a big set up in fact im cloud and ide space trial enterprise here and there all for space. I suck at execution and thats because I dont know how really. I need help from a person. AI has done all it can without hands. Im blabbering at this point. Have nothing big techy to say other than I build and ideate all day hmu glad to meet some like minded individuals ...seriously! Teach me leave me feeling confident in our collaborations not the need to build security software....poor attemt at hacking humor...im neither a comedian or hacker lol....full stacker yep:)
ยท
posted an update about 1 month ago
view post
Post
3911
๐Ÿ˜Š This program is designed to remove emojis from a given text. It uses a regular expression (regex) pattern to match and replace emojis with an empty string, effectively removing them from the text. The pattern includes a range of Unicode characters that correspond to various types of emojis, such as emoticons, symbols, and flags. By using this program, you can clean up text data by removing any emojis that may be present, which can be useful for text processing, analysis, or other applications where emojis are not desired. ๐Ÿ’ป
import re

def remove_emojis(text):
    # Define a broader emoji pattern
    emoji_pattern = re.compile(
        "["
        u"\U0001F600-\U0001F64F"  # emoticons
        u"\U0001F300-\U0001F5FF"  # symbols & pictographs
        u"\U0001F680-\U0001F6FF"  # transport & map symbols
        u"\U0001F1E0-\U0001F1FF"  # flags (iOS)
        u"\U00002702-\U000027B0"
        u"\U000024C2-\U0001F251"
        u"\U0001F900-\U0001F9FF"  # supplemental symbols and pictographs
        u"\U0001FA00-\U0001FA6F"  # chess symbols and more emojis
        u"\U0001FA70-\U0001FAFF"  # more symbols and pictographs
        u"\U00002600-\U000026FF"  # miscellaneous symbols
        u"\U00002B50-\U00002B59"  # additional symbols
        u"\U0000200D"             # zero width joiner
        u"\U0000200C"             # zero width non-joiner
        u"\U0000FE0F"             # emoji variation selector
        "]+", flags=re.UNICODE
    )
    return emoji_pattern.sub(r'', text)
posted an update about 1 month ago
view post
Post
1178
ไธ€ไธชๅŠ ๅ…ฅๆฐดๅฐ็š„ๅฐ็จ‹ๅบ
from PIL import Image, ImageDraw, ImageFont

def add_watermark(image):
    watermark_text = "AI Generated by DarkIdol FeiFei"

    # Ensure the input is an Image object
    if not isinstance(image, Image.Image):
        raise ValueError("Input must be a PIL Image object")

    width, height = image.size

    # Create a drawing object to draw on the image
    draw = ImageDraw.Draw(image)

    # Set the font size for the watermark text
    font_size = 10  # Set font size to 10
    try:
        # Try to use a common font file
        font = ImageFont.truetype("Iansui-Regular.ttf", font_size)
    except IOError:
        # Use the default font if the specified font file is not found
        font = ImageFont.load_default()

    # Calculate the width and height of the watermark text using textbbox
    bbox = draw.textbbox((0, 0), watermark_text, font=font)
    text_width = bbox[2] - bbox[0]
    text_height = bbox[3] - bbox[1]

    # Calculate the position for the watermark text (bottom-right corner)
    x = width - text_width - 10  # 10 is the right margin
    y = height - text_height - 10  # 10 is the bottom margin

    # Add the watermark text to the image
    draw.text((x, y), watermark_text, font=font, fill=(255, 255, 255, 128))

    # Return the modified image object
    return image

- ๅญ—ไฝ“ไปŽhttps://fonts.google.comๅŽปๆ‰พๅฐฑๅฏไปฅไบ†,็จ‹ๅบ้ƒฝๆ ‡ๆณจๆธ…ๆฅšไบ†,่‡ช่กŒไฟฎๆ”น
  • 1 reply
ยท
reacted to m-ric's post with ๐Ÿ‘ 4 months ago
view post
Post
2590
๐‡๐ฎ๐ ๐ ๐ข๐ง๐  ๐…๐š๐œ๐ž ๐ซ๐ž๐ฅ๐ž๐š๐ฌ๐ž๐ฌ ๐๐ข๐œ๐จ๐ญ๐ซ๐จ๐ง, ๐š ๐ฆ๐ข๐œ๐ซ๐จ๐ฌ๐œ๐จ๐ฉ๐ข๐œ ๐ฅ๐ข๐› ๐ญ๐ก๐š๐ญ ๐ฌ๐จ๐ฅ๐ฏ๐ž๐ฌ ๐‹๐‹๐Œ ๐ญ๐ซ๐š๐ข๐ง๐ข๐ง๐  ๐Ÿ’๐ƒ ๐ฉ๐š๐ซ๐š๐ฅ๐ฅ๐ž๐ฅ๐ข๐ณ๐š๐ญ๐ข๐จ๐ง ๐Ÿฅณ

๐Ÿ•ฐ๏ธ Llama-3.1-405B took 39 million GPU-hours to train, i.e. about 4.5 thousand years.

๐Ÿ‘ด๐Ÿป If they had needed all this time, we would have GPU stories from the time of Pharaoh ๐“‚€: "Alas, Lord of Two Lands, the shipment of counting-stones arriving from Cathay was lost to pirates, this shall delay the building of your computing temple by many moons "

๐Ÿ› ๏ธ But instead, they just parallelized the training on 24k H100s, which made it take just a few months.
This required parallelizing across 4 dimensions: data, tensor, context, pipeline.
And it is infamously hard to do, making for bloated code repos that hold together only by magic.

๐Ÿค ๐—•๐˜‚๐˜ ๐—ป๐—ผ๐˜„ ๐˜„๐—ฒ ๐—ฑ๐—ผ๐—ป'๐˜ ๐—ป๐—ฒ๐—ฒ๐—ฑ ๐—ต๐˜‚๐—ด๐—ฒ ๐—ฟ๐—ฒ๐—ฝ๐—ผ๐˜€ ๐—ฎ๐—ป๐˜†๐—บ๐—ผ๐—ฟ๐—ฒ! Instead of building mega-training codes, Hugging Face colleagues cooked in the other direction, towards tiny 4D parallelism libs. A team has built Nanotron, already widely used in industry.
And now a team releases Picotron, a radical approach to code 4D Parallelism in just a few hundred lines of code, a real engineering prowess, making it much easier to understand what's actually happening!

โšก ๐—œ๐˜'๐˜€ ๐˜๐—ถ๐—ป๐˜†, ๐˜†๐—ฒ๐˜ ๐—ฝ๐—ผ๐˜„๐—ฒ๐—ฟ๐—ณ๐˜‚๐—น:
Counting in MFU (Model FLOPs Utilization, how much the model actually uses all the compute potential), this lib reaches ~50% on SmolLM-1.7B model with 8 H100 GPUs, which is really close to what huge libs would reach. (Caution: the team is leading further benchmarks to verify this)

Go take a look ๐Ÿ‘‰ https://github.com/huggingface/picotron/tree/main/picotron
  • 1 reply
ยท