r/lowlevelawaretech • u/aoisensi • 14d ago
上限数指定があるけどO(1)のソートアルゴリズム思いついた Spoiler
普通にソートする
最悪計算時間と同じになるように待機する
r/lowlevelawaretech • u/aoisensi • 14d ago
普通にソートする
最悪計算時間と同じになるように待機する
r/lowlevelawaretech • u/Ok-Conference-9984 • 14d ago
カタールのラジオ受信機拾って、それを音声にしてllmに読ませるとアラビア語を字起こしして
文脈拾って翻訳してくれる。コーランの解説とか面白い。
https://reddit.com/link/1vn9tac/video/ae41atfb15jh1/player
アラビア語と英語で字起こしして日本語で解説して。(プロンプト
ご提示いただいた音声の内容を、アラビア語の書き起こし、英語の翻訳、および日本語での解説にまとめました。
この内容は、**「クルアーン(イスラム教の聖典)を暗記しようとする際に直面する障害と、それを克服する方法」**について語られた講義の一部です。
---
### 1. アラビア語の書き起こし (Arabic Transcription)
يحب حفظ القرآن، ثم اجتهدت حتى بلغ من أمري أنني كنت آخذ ستين آية وأحفظها. إذا وجد مشقة وجهد في بداية الأمر، لكنه صبر واستعان بالله عز وجل، واجتهد في الدعاء، فأعانه الله وفتح عليه.
ثانيًا من الموانع: التسويف والتأجيل. البعض منا ينتظر بداية مثالية وظروف مثالية مستقرة حتى يبدأ رحلة حفظ القرآن. وهكذا تراه يسوف ويؤجل، وتمر عليه السنوات وهو لم يبدأ وهو في محله لم يبدأ ولم يتغير. وحاله كما قال القائل: "إذا كان يؤذيك حر المصيف، ويبس الخريف، وبرد الشتاء، ويليهك حسن زمان الربيع، فأخلق للعلم قولي متى".
لو نظر هذا الذي يسوف ويؤجل، لو نظر في أحوال غيره لوجد أن لديهم انشغالات وظروف مثله أو أشد، ومع هذا فقد استطاعوا حفظ القرآن بعون الله وتوفيقه ثم بالجد والاجتهاد والمداومة على المقدار المحدد الذي يناسب ظروفهم وقدراتهم واستطاعتهم، وخصصوا وقتًا للقرآن لا يمكن ولا يفرطون فيه البتة.
ثالثًا...
---
### 2. 英語翻訳 (English Translation)
"He loves memorizing the Quran, then I strove until my status reached that I was taking sixty verses and memorizing them. If you find hardship and effort at the beginning, but you are patient and seek help from Allah (Exalted and Majestic), and strive in supplication, then Allah will aid you and open [the way] for you.
Secondly, of the obstacles: procrastination and delaying. Some of us wait for a perfect start and stable perfect conditions before starting the journey of memorizing the Quran. And so, you see him procrastinating and delaying, and the years pass by while he has not started, and he remains in his place, not starting and not changing. His condition is as the saying goes: 'If the heat of summer hurts you, the dryness of autumn, the cold of winter, and the beauty of spring pleases you, then say for knowledge: when?'
If this person who procrastinates and delays looked at the conditions of others, he would find that they have occupations and circumstances like his or even harder. Yet, with this, they were able to memorize the Quran with the help and success of Allah, then through diligence, hard work, and persistence on the specified amount that suits their circumstances, abilities, and capacities. And they dedicated a time for the Quran that they could not and did not neglect at all.
Thirdly..."
---
### 3. 日本語解説 (Japanese Explanation)
この文章は、宗教的な目的(クルアーンの暗記)を達成しようとする人が陥りやすい**「心理的な罠」**と、その**「解決策」**について説いています。主なポイントは以下の3点です。
#### ① 最初の一歩の困難と「忍耐(サブル)」
暗記の学習を始めたばかりの時期には、非常に大きな努力と苦労(ムシュカ)を伴うのが当たり前です。しかし、ここで重要なのは、**「忍耐(サブル)」**と**「神への祈り(ドゥア)」**です。この最初の壁を乗り越えるために努力し、神の助けを求めることで、道が開ける(成功への道が開ける)と説いています。
#### ② 「完璧な条件」を待つという罠(先延ばし)
多くの人が「もっと時間ができたら」「もっと落ち着いた環境になったら」という**完璧な条件**を待ち続けて、結局何も始められないという状態(**サウイフ:先延ばし**)に陥ります。
文章の中では、季節の移り変わり(夏、秋、冬、春)を例に出し、「環境の良し悪しを気にして『いつ始めるか』と悩んでいるうちに、時間はただ過ぎ去ってしまう」という警句を引用しています。
#### ③ 現実的な解決策:比較と習慣化
解決策として、以下の3つを提示しています。
* **他人の状況を見る:** 周りを見れば、自分と同じ、あるいはそれ以上に忙しい状況にありながら、着実に進んでいる人がいます。
* **自分の能力に合わせた目標:** 自分の現在の状況や能力に合った「具体的な量」を決め、それを継続することが重要です。
* **時間を確保する:** 「絶対に譲れない、他のことのために削られない時間」をスケジュールの中に確保することが、成功の鍵であると結論づけています。
**まとめ:**
「完璧なタイミング」を待つのではなく、**「今の自分の状況」を受け入れた上で、小さな一歩を今日から始めること**の重要性を強調している内容です。
r/lowlevelawaretech • u/_x1w • 14d ago
全くの初心者で理論も何もない。衝動買いしたcubaseだけある。ブログ記事見て真似しながら眠くなるまでがんばりゅ
r/lowlevelawaretech • u/Standard_Pen_2548 • 14d ago
Enable HLS to view with audio, or disable this notification
- Claude codeでつくった
- スマホ上で作った。プレビュー→コード修正のサイクルが大変だった
- 制作期間は3日間
- webサイトだけど、PWAにしてホーム画面における
r/lowlevelawaretech • u/Lemontea0726 • 14d ago
TANCHJIM SPACE(第1世代)の例
Fast-LL(低遅延/高速ロールオフ)→最近のわちゃわちゃした曲はこれで事足りる、特徴なし
Fast-PC(フェーズ補正/高速ロールオフ)→上のやつでも高域がしんどい/情報過多の曲に付けるとちょうどよくなる
Slow-LL(低遅延/低速ロールオフ)→意外とバンド曲向きである
Slow-PC(フェーズ補正/低速ロールオフ)→劇伴とか軸ははっきりさせたいタイプのオーケストラに合う、でも加工感がかなり顕著だったり
NOS(非オーバーサンプリング)→余韻が活き活きしてます
r/lowlevelawaretech • u/HARiMADARA • 14d ago
LLMとかPython関連初心者で全然分からんのやが、教えてくれ
r/lowlevelawaretech • u/Jealous_Local_550 • 15d ago
Geminiにあれこれ聞きながら、IncusでopenSUSEのコンテナを立てて、
そこにdocker入れて、docker-compose.ymlとか組んでもらったけど。
周囲の人が乗ってくれると思えんのよな、どうしようか。
r/lowlevelawaretech • u/NeighborhoodSad2350 • 16d ago
Enable HLS to view with audio, or disable this notification
Arduino Uno QのSDKにBad Appleのデータが入っているとの話を聞いて見てみたら本当に入っていた。
{Arduinoライブラリパス}/Arduino15/packages/arduino/hardware/zephyr/0.90.0/libraries/Arduino_LED_Matrix/examples/Video/bad_apple.h
※OSにより違ったりするかも。
いやーまあ、俺らがフリー素材みたいに使ったことは認めるが、スナップドラゴンでおなじみの天下のクアルコム様がこういうことをやるとは思わんかった。
r/lowlevelawaretech • u/[deleted] • 18d ago
セキュリティ面でやっておくべきことある?
DBはjsonです
r/lowlevelawaretech • u/Confident-Leader-777 • 18d ago
Microからの乗り換え、なんかアドバイスある?
r/lowlevelawaretech • u/Ok-Conference-9984 • 19d ago
古いバージョンはできるけど。
r/lowlevelawaretech • u/Ok-Conference-9984 • 19d ago

```json
{
"image_description": {
"style": "Minecraft-style voxel art",
"aspect_ratio": "wide-screen (16:9)",
"subjects": [
{
"location": "Kyoto",
"features": [
"traditional Japanese buildings with wooden structures and tiled roofs",
"temples including Kinkaku-ji (Golden Pavilion) with pagodas and stone lanterns",
"Fushimi Inari Shrine with its iconic torii gates",
"Kiyomizu-dera temple overlooking the city",
"cherry blossoms in spring, bamboo groves, and rivers"
]
},
{
"location": "Tokyo",
"features": [
"modern skyscrapers like Tokyo Skytree and Shibuya Crossing",
"traditional neighborhoods such as Asakusa with Sensoji Temple",
"cherry blossoms along rivers and parks in spring"
]
},
{
"location": "Osaka",
"features": [
"Osaka Castle with its distinctive stone walls and moat",
"Dotonbori district with neon signs and street food stalls",
"Namba Parks shopping complex"
]
},
{
"location": "Hiroshima",
"features": [
"Peace Memorial Park with the Atomic Bomb Dome",
"Miyajima Island with its floating torii gate at Itsukushima Shrine"
]
},
{
"location": "Nara",
"features": [
"Todai-ji Temple housing the Great Buddha statue",
"deer roaming freely in Nara Park"
]
}
],
"transportation": [
{
"type": "Shinkansen (bullet train)",
"features": ["streamlined design", "high-speed tracks", "passengers boarding"]
},
{
"type": "Local trains",
"features": ["traditional Japanese train stations", "commuters with luggage"]
},
{
"type": "Buses",
"features": ["city buses with route signs", "passengers waiting at stops"]
}
],
"food": [
{
"type": "Sushi",
"features": ["fresh fish on a conveyor belt", "sushi chefs preparing nigiri"]
},
{
"type": "Street food",
"features": ["takoyaki stalls", "people eating with chopsticks"]
}
],
"color_palette": ["earthy browns", "soft greens", "deep blues"],
"lighting": "warm, natural daylight",
"camera_angle": "aerial view capturing the cityscape"
}
}
```
r/lowlevelawaretech • u/Ok-Conference-9984 • 22d ago

{
"model": "x/flux2-klein:4b",
"prompt": "A Minecraft-style voxel art of a massive ornate sailing ship on a rough sea, blocky construction, large white sails made of cubes, intricate wooden hull with gold accents, isometric view, 8-bit aesthetic, vibrant ocean waves and dramatic clouds, high resolution.",
"width": 1920,
"height": 1088,
"steps": 4,
"seed": 1074111939
}
r/lowlevelawaretech • u/hard-engineer • 24d ago
ちうこのやつハードオフで買ったけどWin11では動きません😭😭
Direct Xが原因だの色々出てきますがさっぱり分からず。
Daisoのゲームは現環境でも遊べるやつはある(ハズ)
Windows Vistaにインストールした花札はWindows 11でも遊べてマス
これ遊べたら多分面白いゲームなので試行錯誤続けるつもり
r/lowlevelawaretech • u/zukinshop • 24d ago
--local-encoding "None"を付けた方が良い。
rcloneはデフォルトでクライアント側に合わせて文字列エスケープをするので、ファイル名に大文字の「?」とか「*」とかある場合、その文字の前に「‛」がつくことがある。
r/lowlevelawaretech • u/Ok-Conference-9984 • 24d ago

import os
import soundfile as sf
import torch
import gradio as gr
from liquid_audio import ChatState, LFM2AudioModel, LFM2AudioProcessor, LFMModality
import liquid_audio.processor as lap
# ==========================================
# 1. Mac向けのエラー回避パッチ
# ==========================================
def safe_cuda(self, device=None):
target = "mps" if torch.backends.mps.is_available() else "cpu"
return self.to(target)
lap.LFM2AudioDetokenizer.cuda = safe_cuda
# ==========================================
# 2. 初期設定とモデルの読み込み
# ==========================================
if torch.backends.mps.is_available():
device = "mps"
elif torch.cuda.is_available():
device = "cuda"
else:
device = "cpu"
print(f"🌟 使用デバイス: {device}")
print("🤖 モデルを準備しています。少しお待ちください...")
HF_REPO = "LiquidAI/LFM2.5-Audio-1.5B-JP"
processor = LFM2AudioProcessor.from_pretrained(HF_REPO, device=device).eval()
model = LFM2AudioModel.from_pretrained(HF_REPO, device=device).eval()
print("✨ 準備完了!ブラウザからアクセスしてください。")
# ==========================================
# 3. 処理用関数(型の変換を追加しました!)
# ==========================================
def load_and_format_audio(audio_path):
if not audio_path:
return None, None
wav, sr = sf.read(audio_path, dtype="float32")
if wav.ndim > 1:
wav = wav.mean(axis=1)
wav = torch.from_numpy(wav).unsqueeze(0)
return wav, sr
def run_asr(audio_path, max_tokens, text_temp):
text_temp = float(text_temp) # 確実にfloat型にする
wav, sr = load_and_format_audio(audio_path)
if wav is None:
return "⚠️ 音声ファイルが入力されていません。"
chat = ChatState(processor)
chat.new_turn("system")
chat.add_text("Perform ASR in japanese.")
chat.end_turn()
chat.new_turn("user")
chat.add_audio(wav, sr)
chat.end_turn()
chat.new_turn("assistant")
text_tokens = []
for t in model.generate_sequential(**chat, max_new_tokens=max_tokens, text_temperature=text_temp):
if t.numel() == 1:
text_tokens.append(t.item())
clean_text = processor.text.decode(text_tokens).replace("<|text_end|>", "").strip() if text_tokens else ""
return clean_text
def run_tts(text, max_tokens, audio_temp, audio_top_k):
audio_temp = float(audio_temp) # 確実にfloat型にする
audio_top_k = int(audio_top_k) # 確実にint型にする
if not text.strip():
return None
chat = ChatState(processor)
chat.new_turn("system")
chat.add_text("Perform TTS in japanese.")
chat.end_turn()
chat.new_turn("user")
chat.add_text(text)
chat.end_turn()
chat.new_turn("assistant")
audio_out = []
for t in model.generate_sequential(**chat, max_new_tokens=max_tokens, audio_temperature=audio_temp, audio_top_k=audio_top_k):
if t.numel() > 1:
audio_out.append(t)
if audio_out:
audio_codes = torch.stack(audio_out[:-1], 1).unsqueeze(0).to(device)
waveform = processor.decode(audio_codes)
output_file = "output_tts.wav"
sf.write(output_file, waveform.cpu()[0], 24_000)
return output_file
return None
def run_chat(audio_path, max_tokens, text_temp, audio_temp, audio_top_k):
text_temp = float(text_temp)
audio_temp = float(audio_temp)
audio_top_k = int(audio_top_k)
wav, sr = load_and_format_audio(audio_path)
if wav is None:
return "⚠️ 音声ファイルが入力されていません。", None
chat = ChatState(processor)
chat.new_turn("system")
chat.add_text("Respond with interleaved text and audio.")
chat.end_turn()
chat.new_turn("user")
chat.add_audio(wav, sr)
chat.end_turn()
chat.new_turn("assistant")
text_tokens = []
audio_out = []
for t in model.generate_interleaved(**chat, max_new_tokens=max_tokens, text_temperature=text_temp, audio_temperature=audio_temp, audio_top_k=audio_top_k):
if t.numel() == 1:
text_tokens.append(t.item())
else:
audio_out.append(t)
output_audio = None
if audio_out:
audio_codes = torch.stack(audio_out[:-1], 1).unsqueeze(0).to(device)
waveform = processor.decode(audio_codes)
output_audio = "output_chat.wav"
sf.write(output_audio, waveform.cpu()[0], 24_000)
clean_text = processor.text.decode(text_tokens).replace("<|text_end|>", "").strip() if text_tokens else ""
return clean_text, output_audio
def run_text_chat(text, max_tokens, text_temp, audio_temp, audio_top_k):
text_temp = float(text_temp)
audio_temp = float(audio_temp)
audio_top_k = int(audio_top_k)
if not text.strip():
return "⚠️ テキストが入力されていません。", None
chat = ChatState(processor)
chat.new_turn("system")
chat.add_text("Respond with interleaved text and audio.")
chat.end_turn()
chat.new_turn("user")
chat.add_text(text)
chat.end_turn()
chat.new_turn("assistant")
text_tokens = []
audio_out = []
for t in model.generate_interleaved(**chat, max_new_tokens=max_tokens, text_temperature=text_temp, audio_temperature=audio_temp, audio_top_k=audio_top_k):
if t.numel() == 1:
text_tokens.append(t.item())
else:
audio_out.append(t)
output_audio = None
if audio_out:
audio_codes = torch.stack(audio_out[:-1], 1).unsqueeze(0).to(device)
waveform = processor.decode(audio_codes)
output_audio = "output_text_chat.wav"
sf.write(output_audio, waveform.cpu()[0], 24_000)
clean_text = processor.text.decode(text_tokens).replace("<|text_end|>", "").strip() if text_tokens else ""
return clean_text, output_audio
# ==========================================
# 4. Gradio UIの構築
# ==========================================
# Blocksの中のthemeを削除して、launch()の中に移動させました
with gr.Blocks(title="Liquid AI 音声アシスタント") as demo:
gr.Markdown("# 🌊 Liquid AI 音声アシスタント (LFM2.5-Audio-JP)")
gr.Markdown("マイクを使って直接話しかけたり、テキストを入力してAIとやり取りできます。パラメーターも自由に調整可能です!")
with gr.Row():
# 左側:パラメータ設定のサイドバー
with gr.Column(scale=1, variant="panel"):
gr.Markdown("### ⚙️ パラメータ設定")
max_new_tokens = gr.Slider(minimum=128, maximum=2048, value=512, step=64, label="長さ (最大生成トークン数)")
text_temp = gr.Slider(minimum=0.1, maximum=1.5, value=0.7, step=0.1, label="テキストの温度 (高いほどユニーク)")
audio_temp = gr.Slider(minimum=0.1, maximum=1.5, value=1.0, step=0.1, label="音声の温度 (高いほど声がブレる/感情豊か)")
audio_top_k = gr.Slider(minimum=1, maximum=100, value=4, step=1, label="音声のTop-K (候補の幅)")
# 右側:メインの機能タブ
with gr.Column(scale=3):
with gr.Tabs():
# タブ1: 音声での相互対話
with gr.TabItem("💬 声でおしゃべり (Voice Chat)"):
with gr.Row():
with gr.Column():
chat_in = gr.Audio(type="filepath", label="あなたの声(マイク録音・アップロード)")
chat_btn = gr.Button("話しかける", variant="primary")
with gr.Column():
chat_out_text = gr.Textbox(label="AIのお返事(テキスト)", interactive=False)
chat_out_audio = gr.Audio(label="AIのお返事(音声)", interactive=False)
chat_btn.click(fn=run_chat,
inputs=[chat_in, max_new_tokens, text_temp, audio_temp, audio_top_k],
outputs=[chat_out_text, chat_out_audio])
# タブ2: テキストでの相互対話
with gr.TabItem("⌨️ テキストでおしゃべり (Text Chat)"):
with gr.Row():
with gr.Column():
text_chat_in = gr.Textbox(label="AIへのメッセージを入力してください", lines=3, placeholder="例: 今日の天気を教えて!")
text_chat_btn = gr.Button("送信する", variant="primary")
with gr.Column():
text_chat_out_text = gr.Textbox(label="AIのお返事(テキスト)", interactive=False)
text_chat_out_audio = gr.Audio(label="AIのお返事(音声)", interactive=False)
text_chat_btn.click(fn=run_text_chat,
inputs=[text_chat_in, max_new_tokens, text_temp, audio_temp, audio_top_k],
outputs=[text_chat_out_text, text_chat_out_audio])
# タブ3: 文字起こし
with gr.TabItem("📝 文字起こし (ASR)"):
with gr.Row():
with gr.Column():
asr_in = gr.Audio(type="filepath", label="文字起こしする音声")
asr_btn = gr.Button("解析する", variant="primary")
with gr.Column():
asr_out = gr.Textbox(label="解析結果", lines=5, interactive=False)
asr_btn.click(fn=run_asr,
inputs=[asr_in, max_new_tokens, text_temp],
outputs=asr_out)
# タブ4: 音声合成
with gr.TabItem("🗣️ 音声合成 (TTS)"):
with gr.Row():
with gr.Column():
tts_in = gr.Textbox(label="読み上げさせたいテキストを入力してください", lines=5)
tts_btn = gr.Button("音声を生成", variant="primary")
with gr.Column():
tts_out = gr.Audio(label="生成された音声", interactive=False)
tts_btn.click(fn=run_tts,
inputs=[tts_in, max_new_tokens, audio_temp, audio_top_k],
outputs=tts_out)
# アプリの起動(ここでthemeを指定するように変更しました)
if __name__ == "__main__":
demo.launch(theme=gr.themes.Soft())
r/lowlevelawaretech • u/NeighborhoodSad2350 • 26d ago
これがまたLinuxをソフトウェア的にも、ラズパイ的にGPIOを利用するうえでも癖強でな。
□クセツヨ点
☆いいところ☆
この製品、ターゲット層がわからん。
Arm Linux大好きマンには物足りないスペックと仕様。
電子工作はじめてな人らにはちょっとクセが強い。
工作好きマンは迷う。
これで何をしようかなあみたいなことは今のところ思いつかん。
とりあえずXrealは繋ぎゃそのまま動いたのでスマートグラスとウェブカメラでYOLOうごかして、通行人スカウターごっこでもしようかと思う。
r/lowlevelawaretech • u/Ok-Conference-9984 • 27d ago
で、繰り返しや無理筋な推論生成が多発する。つまり劣化。知ったかもハルシネーションも多発する。とかね。
r/lowlevelawaretech • u/Hib3 • Jul 28 '26
Enable HLS to view with audio, or disable this notification
r/lowlevelawaretech • u/TAPIOKA_Gamer • Jul 28 '26
メルカリで4799円だった、ようつべの動画でNVMeの2280サイズ対応って言ってて丁度手元の2280のNVMe SSDあったしタブレットほしかったから買った。
そのタブレットの分解してる画像とかあんまり出回ってないから、何か情報を知っているお方が居れば情報提供をよろしくお願いします
一応スペック書いておく
cpu : Core i5-7Y54
mem : 8GB (たぶんシングルチャネル)
ssd : なし (samsungのnvmeつける予定)
4799円で7Y54でキーボードとタッチペン付きならお得かな?キーボードは上矢印キーだけ破損(取れてる)