mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
server: update process tools and tests
This commit is contained in:
@@ -48,6 +48,13 @@ $ LLM_URL=http://.../api/v1/generate python -m reflector.app
|
||||
- Ensure the API server is activated in GPT4all
|
||||
- Run with: `LLM_BACKEND=openai LLM_URL=http://localhost:4891/v1/completions LLM_OPENAI_MODEL="GPT4All Falcon" python -m reflector.app`
|
||||
|
||||
|
||||
### Using local files
|
||||
|
||||
```
|
||||
poetry run python -m reflector.tools.process path/to/audio.wav
|
||||
```
|
||||
|
||||
# Old documentation
|
||||
|
||||
This is the code base for the Reflector demo (formerly called agenda-talk-diff) for the leads : Troy Web Consulting
|
||||
|
||||
@@ -29,4 +29,5 @@ app.include_router(rtc_offer_router)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
uvicorn.run("reflector.app:app", host="0.0.0.0", port=1250, reload=True)
|
||||
|
||||
@@ -7,7 +7,7 @@ from reflector.processors import (
|
||||
AudioTranscriptAutoProcessor,
|
||||
TranscriptLinerProcessor,
|
||||
TranscriptTopicDetectorProcessor,
|
||||
# TranscriptSummarizerProcessor,
|
||||
TranscriptFinalSummaryProcessor,
|
||||
)
|
||||
import asyncio
|
||||
|
||||
@@ -29,9 +29,7 @@ async def process_audio_file(filename, event_callback):
|
||||
AudioTranscriptAutoProcessor.as_threaded(),
|
||||
TranscriptLinerProcessor(callback=on_transcript),
|
||||
TranscriptTopicDetectorProcessor.as_threaded(callback=on_topic),
|
||||
# TranscriptSummarizerProcessor.as_threaded(
|
||||
# callback=on_summary
|
||||
# ),
|
||||
TranscriptFinalSummaryProcessor.as_threaded(callback=on_summary),
|
||||
)
|
||||
pipeline.describe()
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ import asyncio
|
||||
from fastapi import Request, APIRouter
|
||||
from reflector.events import subscribers_shutdown
|
||||
from pydantic import BaseModel
|
||||
from reflector.models import (
|
||||
TranscriptionContext,
|
||||
TranscriptionOutput,
|
||||
)
|
||||
from reflector.models import TranscriptionContext
|
||||
from reflector.logger import logger
|
||||
from aiortc import RTCPeerConnection, RTCSessionDescription, MediaStreamTrack
|
||||
from json import loads, dumps
|
||||
|
||||
@@ -26,7 +26,7 @@ async def test_basic_process(event_loop):
|
||||
marks = {
|
||||
"transcript": 0,
|
||||
"topic": 0,
|
||||
# "summary": 0,
|
||||
"summary": 0,
|
||||
}
|
||||
|
||||
async def event_callback(event, data):
|
||||
@@ -40,5 +40,5 @@ async def test_basic_process(event_loop):
|
||||
|
||||
# validate the events
|
||||
assert marks["transcript"] == 5
|
||||
assert marks["topic"] == 4
|
||||
# assert marks["summary"] == 1
|
||||
assert marks["topic"] == 2
|
||||
assert marks["summary"] == 1
|
||||
|
||||
Reference in New Issue
Block a user