小编Ser*_*sov的帖子

如何在 google colab 中运行 ollama?

我有一个这样的代码。我正在启动它。我得到一个 ngrok 链接。

!pip install aiohttp pyngrok

import os
import asyncio
from aiohttp import ClientSession

# Set LD_LIBRARY_PATH so the system NVIDIA library becomes preferred
# over the built-in library. This is particularly important for
# Google Colab which installs older drivers
os.environ.update({'LD_LIBRARY_PATH': '/usr/lib64-nvidia'})

async def run(cmd):
  '''
  run is a helper function to run subcommands asynchronously.
  '''
  print('>>> starting', *cmd)
  p = await asyncio.subprocess.create_subprocess_exec(
      *cmd,
      stdout=asyncio.subprocess.PIPE,
      stderr=asyncio.subprocess.PIPE,
  )

  async def pipe(lines):
    async for line in lines:
      print(line.strip().decode('utf-8'))

  await asyncio.gather( …
Run Code Online (Sandbox Code Playgroud)

python pyngrok ollama

5
推荐指数
1
解决办法
3569
查看次数

标签 统计

ollama ×1

pyngrok ×1

python ×1